Matthew Else / Mbed 2 deprecated ShieldBotExample

Dependencies:   SeeedStudioShieldBot mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "SeeedStudioShieldBot.h"
00003 
00004 SeeedStudioShieldBot bot;
00005 float speed = 0;
00006 
00007 int main() {
00008     bot.enable_right_motor();
00009     bot.enable_left_motor();
00010     
00011     while(1) {
00012         speed += 0.1;
00013         bot.forward(speed);
00014         wait_ms(1000);
00015         if (speed == 1) {
00016             speed = 0;
00017         }
00018     }
00019 }