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.
Fork of TVDctrller2017_brdRev1_ver6 by
Diff: TVDcontrolDEMO_main.cpp
- Revision:
- 6:26fa8c78500e
- Parent:
- 5:a5462959b3ab
- Child:
- 8:a22aec357a64
diff -r a5462959b3ab -r 26fa8c78500e TVDcontrolDEMO_main.cpp --- a/TVDcontrolDEMO_main.cpp Mon Jul 25 07:12:49 2016 +0000 +++ b/TVDcontrolDEMO_main.cpp Tue Jul 26 05:12:15 2016 +0000 @@ -47,7 +47,7 @@ RTDSW.mode(PullUp); SDState.mode(PullUp); - + indicateSystem(1); bootSystem(); } @@ -55,7 +55,7 @@ int main(void) { pc.baud(115200); - + printf("\r\nVersion:TVDcontrolDEMO...start!!!!!\r\n"); initIO(); //IOポート初期化 @@ -65,21 +65,21 @@ initSteering(); timer.start(); - + float time; while(1) { //struct errCounter_t eCounter={0,0,0,0,0,0,0,0}; //getCurrentErrCount(&eCounter); - + timer.reset(); driveTVD(); - + //printf("%f\n\r", 45.0/0xFFFF * calcRequestTorque()); - - printf("%1.2f\t%d\t%1.6f\t%1.5f\r\n", 45.0f / 0xffff * calcRequestTorque(), getPulseTime(RIGHT_MOTOR), time, getSteerAngle()); + + printf("%1.2f\t%d\t%1.6f\t%1.5f\r\n", 45.0f / 0xffff * calcRequestTorque(), (int)(1.0/(getPulseTime(RIGHT_MOTOR)*0.000001)*60.0), time, getSteerAngle()); //printf("%1.6f\r\n", time); time = timer.read();