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-rtos mbed PinDetect
Fork of FinalMotorControl by
Revision 4:4d655fdae399, committed 2016-04-13
- Comitter:
- mjhaugsdal
- Date:
- Wed Apr 13 10:10:23 2016 +0000
- Parent:
- 3:15be78948724
- Child:
- 5:fdc7a779d525
- Commit message:
- Made new cases for m_cmd to control speed and direction in the same case;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Apr 08 13:27:08 2016 +0000
+++ b/main.cpp Wed Apr 13 10:10:23 2016 +0000
@@ -87,28 +87,43 @@
while (true)
{
+ //Thread::wait(5);
-
+ //0 STEPS LEFT AT MAX SPEED
if (m_cmd == '0')
{
+ fart = 1000;
global_direction = '0';
step4Left();
+ //printf("LEFT \n");
//printf("%c \n" + global_direction);
}
+ //1 STEPS RIGHT AT MAX SPEED
else if (m_cmd == '1')
{
+ fart = 1000;
global_direction = '1';
step4Right();
//printf("RIGHT \n");
+
}
+ else
+ {
+ global_direction = 'x';
+ }
if (m_cmd == 'a')
{
- fart = 1000;
+ fart = 2000;
+ global_direction = '1';
+ step4Right();
}
- else if (m_cmd == 'b')
+
+ else if (m_cmd == 'c')
{
- fart = 5000;
+ fart = 2000;
+ global_direction = '0';
+ step4Left();
}
if (global_direction =='0')
{
@@ -118,10 +133,7 @@
{
step4Right();
}
- else
- {
- global_direction = 'x';
- }
+
}
} //END Main
