Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Global.cpp
- Revision:
- 13:a8e10a69df45
- Parent:
- 12:8e39bb45c61c
- Child:
- 16:7e36177b4435
diff -r 8e39bb45c61c -r a8e10a69df45 Global.cpp --- a/Global.cpp Sat Nov 28 18:47:26 2015 +0000 +++ b/Global.cpp Sun Nov 29 20:44:35 2015 +0000 @@ -7,7 +7,6 @@ Queue<char, 20> Global::initqueue; -Queue<float, 50> Global::displayqueue; //----------------普段は変動しない変数(定数)------------------------------------------------------ //サーボのパラメータ(角度(度数法)で設定)max,minはニュートラルを基準にしている double Global::maxpitch = 5.0; @@ -43,16 +42,16 @@ double Global::ultsonic; double Global::atmpress; -int Global::pitchcnt; -int Global::pitchdegreecnt; -int Global::inttrimpitchcnt; -int Global::yawcnt; -int Global::yawdegreecnt; -int Global::inttrimyawcnt; -int Global::airspeedcnt; -int Global::cadencecnt; -int Global::ultsoniccnt; -int Global::atmpresscnt; +int Global::pitchtime; +int Global::pitchdegreetime; +int Global::inttrimpitchtime; +int Global::yawtime; +int Global::yawdegreetime; +int Global::inttrimyawtime; +int Global::airspeedtime; +int Global::cadencetime; +int Global::ultsonictime; +int Global::atmpresstime; //----------------どこからでも使えるled,スイッチ,タイマーの一括管理----------------------------- Timer Global::timer; @@ -190,36 +189,56 @@ double Global::getultsonic(){return ultsonic;} double Global::getatmpress(){return atmpress;} +int Global::getpitchtime(){return pitchtime;} +int Global::getpitchdegreetime(){return pitchdegreetime;} +int Global::getinttrimpitchtime(){return inttrimpitchtime;} +int Global::getyawtime(){return yawtime;} +int Global::getyawdegreetime(){return yawdegreetime;} +int Global::getinttrimyawtime(){return inttrimyawtime;} +int Global::getairspeedtime(){return airspeedtime;} +int Global::getcadencetime(){return cadencetime;} +int Global::getultsonictime(){return ultsonictime;} +int Global::getatmpresstime(){return atmpresstime;} + + void Global::setpitch(double _pitch){ pitch = _pitch; + pitchtime = timer.read_ms(); } void Global::setpitchdegree(double _pitchdegree){ pitchdegree = _pitchdegree; + pitchdegreetime = timer.read_ms(); } void Global::setinttrimpitch(int _inttrimpitch){ inttrimpitch = _inttrimpitch; + inttrimpitchtime = timer.read_ms(); } void Global::setyaw(double _yaw){ yaw = _yaw; + yawtime = timer.read_ms(); } void Global::setyawdegree(double _yawdegree){ yawdegree = _yawdegree; + yawdegreetime = timer.read_ms(); } void Global::setinttrimyaw(int _inttrimyaw){ inttrimyaw = _inttrimyaw; + inttrimyawtime = timer.read_ms(); } void Global::setairspeed(double _airspeed){ airspeed = _airspeed; + airspeedtime = timer.read_ms(); } void Global::setcadence(double _cadence){ cadence = _cadence; + cadencetime = timer.read_ms(); } void Global::setultsonic(double _ultsonic){ ultsonic = _ultsonic; + ultsonictime = timer.read_ms(); } void Global::setatmpress(double _atmpress){ atmpress = _atmpress; + atmpresstime = timer.read_ms(); } - -