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 MotorControl by
Diff: main.cpp
- Revision:
- 4:4d655fdae399
- Parent:
- 3:15be78948724
- Child:
- 5:fdc7a779d525
diff -r 15be78948724 -r 4d655fdae399 main.cpp
--- 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
