kubtss / Mbed 2 deprecated BIRD2017

Dependencies:   mbed-rtos mbed

Committer:
shimogamo
Date:
Tue Sep 29 18:23:29 2015 +0000
Revision:
4:650af94bf062
Parent:
3:e3c41153e5fe
Child:
5:9a1ec02229dd
angle?????Global??????????????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimogamo 0:2a15bd367891 1 #include "mbed.h"
shimogamo 0:2a15bd367891 2 #include "Global.h"
shimogamo 3:e3c41153e5fe 3
shimogamo 3:e3c41153e5fe 4 //トリムはGlobalで足したほうがいいかも
shimogamo 3:e3c41153e5fe 5
shimogamo 3:e3c41153e5fe 6
shimogamo 3:e3c41153e5fe 7 //----------------普段は変動しない変数(定数)------------------------------------------------------
shimogamo 4:650af94bf062 8 //サーボのパラメータ(角度(deg)で設定)
shimogamo 4:650af94bf062 9 double Global::maxpitch = 5.0;
shimogamo 4:650af94bf062 10 double Global::minpitch = -5.0;
shimogamo 4:650af94bf062 11 double Global::neutralpitch = 0;
shimogamo 4:650af94bf062 12 double Global::maxyaw = 30.0;
shimogamo 4:650af94bf062 13 double Global::minyaw = -30.0;
shimogamo 4:650af94bf062 14 double Global::neutralyaw = 0;
shimogamo 4:650af94bf062 15 //ジョイスティックのパラメータ(mbedのAnalogIn値[0,1])
shimogamo 4:650af94bf062 16 double Global::maxpitchdegree = 1.0;
shimogamo 4:650af94bf062 17 double Global::minpitchdegree = 0;
shimogamo 4:650af94bf062 18 double Global::neutralpitchdegree = 0.5;
shimogamo 4:650af94bf062 19 double Global::maxyawdegree = 1.0;
shimogamo 4:650af94bf062 20 double Global::minyawdegree = 0;
shimogamo 4:650af94bf062 21 double Global::neutralyawdegree = 0.5;
shimogamo 3:e3c41153e5fe 22
shimogamo 3:e3c41153e5fe 23 //----------------周期的に変動する変数------------------------------------------------------
shimogamo 0:2a15bd367891 24 double Global::trimpitch;
shimogamo 0:2a15bd367891 25 double Global::trimyaw;
shimogamo 0:2a15bd367891 26 double Global::inttrimpitch;
shimogamo 0:2a15bd367891 27 double Global::inttrimyaw;
shimogamo 1:3f857674a290 28 double Global::pitch;
shimogamo 1:3f857674a290 29 double Global::yaw;
shimogamo 1:3f857674a290 30 double Global::airspeed;
shimogamo 1:3f857674a290 31 double Global::cadence;
shimogamo 1:3f857674a290 32 double Global::altitude;
shimogamo 0:2a15bd367891 33
shimogamo 4:650af94bf062 34 //----------------どこからでも使えるled,スイッチ,タイマーの一括管理-----------------------------
shimogamo 0:2a15bd367891 35 Timer Global::timer;
shimogamo 0:2a15bd367891 36 DigitalIn Global::initializeswitch(p23,PullUp);//否定で押しているとき
shimogamo 0:2a15bd367891 37 DigitalOut Global::led1(LED1);
shimogamo 0:2a15bd367891 38 DigitalOut Global::led2(LED2);
shimogamo 0:2a15bd367891 39 DigitalOut Global::led3(LED3);
shimogamo 0:2a15bd367891 40 DigitalOut Global::led4(LED4);
shimogamo 0:2a15bd367891 41
shimogamo 1:3f857674a290 42
shimogamo 4:650af94bf062 43 //定数チックな変数
shimogamo 4:650af94bf062 44 double Global::getmaxpitch(){return maxpitch;}
shimogamo 4:650af94bf062 45 double Global::getminpitch(){return minpitch;}
shimogamo 4:650af94bf062 46 double Global::getneutralpitch(){return neutralpitch;}
shimogamo 4:650af94bf062 47 double Global::getmaxyaw(){return maxyaw;}
shimogamo 4:650af94bf062 48 double Global::getminyaw(){return minyaw;}
shimogamo 4:650af94bf062 49 double Global::getneutralyaw(){return neutralyaw;}
shimogamo 4:650af94bf062 50
shimogamo 4:650af94bf062 51 void Global::setmaxpitch(double _maxpitch){maxpitch = _maxpitch;}
shimogamo 4:650af94bf062 52 void Global::setminpitch(double _minpitch){minpitch = _minpitch;}
shimogamo 4:650af94bf062 53 void Global::setneutralpitch(double _neutralpitch){neutralpitch = _neutralpitch;}
shimogamo 4:650af94bf062 54 void Global::setmaxyaw(double _maxyaw){maxyaw = _maxyaw;}
shimogamo 4:650af94bf062 55 void Global::setminyaw(double _minyaw){minyaw = _minyaw;}
shimogamo 4:650af94bf062 56 void Global::setneutralyaw(double _neutralyaw){neutralyaw = _neutralyaw;}
shimogamo 4:650af94bf062 57
shimogamo 4:650af94bf062 58 double Global::getmaxpitchdegree(){return maxpitchdegree;}
shimogamo 4:650af94bf062 59 double Global::getneutralpitchdegree(){return neutralpitchdegree;}
shimogamo 4:650af94bf062 60 double Global::getminpitchdegree(){return minpitchdegree;}
shimogamo 4:650af94bf062 61 double Global::getmaxyawdegree(){return maxyawdegree;}
shimogamo 4:650af94bf062 62 double Global::getneutralyawdegree(){return neutralyawdegree;}
shimogamo 4:650af94bf062 63 double Global::getminyawdegree(){return minyawdegree;}
shimogamo 4:650af94bf062 64
shimogamo 0:2a15bd367891 65 void Global::setmaxpitchdegree(double _maxpitchdegree){maxpitchdegree=_maxpitchdegree;}
shimogamo 0:2a15bd367891 66 void Global::setneutralpitchdegree(double _neutralpitchdegree){neutralpitchdegree=_neutralpitchdegree;}
shimogamo 0:2a15bd367891 67 void Global::setminpitchdegree(double _minpitchdegree){minpitchdegree=_minpitchdegree;}
shimogamo 0:2a15bd367891 68 void Global::setmaxyawdegree(double _maxyawdegree){maxyawdegree=_maxyawdegree;}
shimogamo 0:2a15bd367891 69 void Global::setneutralyawdegree(double _neutralyawdegree){neutralyawdegree=_neutralyawdegree;}
shimogamo 0:2a15bd367891 70 void Global::setminyawdegree(double _minyawdegree){minyawdegree=_minyawdegree;}
shimogamo 4:650af94bf062 71
shimogamo 4:650af94bf062 72
shimogamo 1:3f857674a290 73
shimogamo 1:3f857674a290 74
shimogamo 1:3f857674a290 75
shimogamo 0:2a15bd367891 76 //変数
shimogamo 1:3f857674a290 77 double Global::getpitch(){return pitch;}
shimogamo 1:3f857674a290 78 double Global::gettrimpitch(){return trimpitch;}
shimogamo 1:3f857674a290 79 double Global::getinttrimpitch(){return inttrimpitch;}
shimogamo 1:3f857674a290 80 double Global::getyaw(){return yaw;}
shimogamo 1:3f857674a290 81 double Global::gettrimyaw(){return trimyaw;}
shimogamo 1:3f857674a290 82 double Global::getinttrimyaw(){return inttrimyaw;}
shimogamo 1:3f857674a290 83 double Global::getairspeed(){return airspeed;}
shimogamo 1:3f857674a290 84 double Global::getcadence(){return cadence;}
shimogamo 1:3f857674a290 85 double Global::getaltitude(){return altitude;}
shimogamo 0:2a15bd367891 86
shimogamo 1:3f857674a290 87 void Global::setpitch(double _pitch){pitch = _pitch;}
shimogamo 1:3f857674a290 88 void Global::settrimpitch(double _trimpitch){trimpitch = _trimpitch;}
shimogamo 1:3f857674a290 89 void Global::setinttrimpitch(double _inttrimpitch){inttrimpitch = _inttrimpitch;}
shimogamo 1:3f857674a290 90 void Global::setyaw(double _yaw){yaw = _yaw;}
shimogamo 1:3f857674a290 91 void Global::settrimyaw(double _trimyaw){trimyaw = _trimyaw;}
shimogamo 1:3f857674a290 92 void Global::setinttrimyaw(double _inttrimyaw){inttrimyaw = _inttrimyaw;}
shimogamo 1:3f857674a290 93 void Global::setairspeed(double _airspeed){airspeed = _airspeed;}
shimogamo 1:3f857674a290 94 void Global::setcadence(double _cadence){cadence = _cadence;}
shimogamo 1:3f857674a290 95 void Global::setaltitude(double _altitude){altitude = _altitude;}
shimogamo 4:650af94bf062 96