Example program for the Seeed Studio Shield Bot
Dependencies: SeeedStudioShieldBot mbed
Diff: main.cpp
- Revision:
- 0:96c652480857
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jul 15 14:09:05 2013 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "SeeedStudioShieldBot.h" + +SeeedStudioShieldBot bot; +float speed = 0; + +int main() { + bot.enable_right_motor(); + bot.enable_left_motor(); + + while(1) { + speed += 0.1; + bot.forward(speed); + wait_ms(1000); + if (speed == 1) { + speed = 0; + } + } +}