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: main.cpp
- Revision:
- 1:d43df9a7cef2
- Parent:
- 0:3ead6014ad51
--- a/main.cpp Sun Nov 03 23:28:27 2019 +0000 +++ b/main.cpp Sat Oct 31 07:12:28 2020 +0000 @@ -28,18 +28,19 @@ { wait(1); - //Set the 1ms thicker. + + ////Set the 1ms thicker. Ticker ticker_1ms; - ticker_1ms.attach (&counter_1ms, 0.001); + ticker_1ms.attach(&counter_1ms, 0.001); + + //Set the motor to 10%. + motor.setSpeed_percent(10.0, FORWARD); while(1) { // Every 1 ms, if(uiFlag_1ms >= 1) { uiFlag_1ms = 0; - //Set the motor to 10%. - motor.setSpeed_percent(10.0, FORWARD); - //If A is 0, turn on the LED. myled1 = hall.getPinState(); } @@ -52,10 +53,10 @@ plot.reset (); // put data to buffer - plot.put (hall.getSpeed_rps(), 0); + plot.put(hall.getSpeed_rps(), 0); // send buffer - plot.send (&pc); + plot.send(&pc); } } } \ No newline at end of file