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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 6:549177f76f8e
- Parent:
- 4:bf4ad2079096
- Child:
- 7:8fb5513a2231
--- a/main.cpp Fri Dec 21 20:39:24 2018 +0000 +++ b/main.cpp Wed Dec 26 10:54:31 2018 +0000 @@ -91,7 +91,10 @@ case 2 : bt.puts("ANYBARO"); - break; + break; + + default: + break; } } @@ -105,7 +108,13 @@ { float d1 = disSensor.read(); float d2 = parA*d1*d1+parB*d1+parC; - bt.printf("%1.2f",d2); + +// original +// bt.printf("%1.2f",d2); + +// fixed + bt.printf("<DIO%1.4f>",d2); + } void ModeSelect(int mode) // [ADD] MODE @@ -144,7 +153,7 @@ case 3 : //Read Angle timer2.detach(); - ReadAng(); + ReadAng(); // return only one message break; @@ -169,7 +178,7 @@ if( 1 == sysStatus | 2 == sysStatus) { - bt.puts("Please Wait Moving Anybaro"); + bt.puts("Please Wait Moving Anybaro"); //<STA> } else { @@ -184,7 +193,8 @@ { if( 1 == sysStatus | 2 == sysStatus) { - bt.puts("Please Wait Moving Anybaro"); + bt.puts("Please Wait Moving Anybaro"); //<STA> 또는 ifdef debug 처리? + } else { @@ -196,11 +206,11 @@ { bt.baud(115200); pc.baud(115200); - bt.puts("START 181203 Ver.6 \n"); + bt.puts("START 181203 Ver.6 \n"); // ifdef debug - int modeNum = 0; + int modeNum = 0; int modeLED = 0; - int modeMotor =0; + int modeMotor = 0; char tmpCommand[4]={0,}; // [ADD] command int rxVal; @@ -237,7 +247,7 @@ #ifdef DEBUG bt.puts("\nLED CONTROL MODE!!\n"); #endif - modeLED = rxVal; + modeLED = rxVal; // if(modeLED != 0 || modeLED != 1 || modeLED != 2) ControlLED(modeLED); } @@ -246,8 +256,9 @@ #ifdef DEBUG bt.puts("\nMODE SELECT!!\n"); #endif - modeNum = rxVal; - sysStatus = rxVal; + modeNum = rxVal; // 1 ~ 6 + sysStatus = rxVal; // Why this value are assigned directly? + // assigning sys variable after checking condition is correct progress, i think. ModeSelect(modeNum); } @@ -257,14 +268,14 @@ bt.puts("\nMOTOR TEST CONTROL MODE!!\n"); #endif modeMotor = rxVal; - MotorTest(modeMotor); + MotorTest(modeMotor); } else if (0 == strcmp(tmpCommand,"POS")) { #ifdef DEBUG bt.puts("\nMOTOR DISTANCE CONTROL MODE!!\n"); - #endif + #endif targetDis = rxVal; timer1.attach(&ControlAng,0.8); }