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.
main.cpp
00001 #include "mbed.h" 00002 #include "Motor.h" 00003 00004 Motor m1(D10, D8, D9); //pwm (E1), fwd (1A), rev (1B) 00005 Motor m2(D5, D6, D7); //pwm (E2), fwd (2A), rev (2B) 00006 DigitalIn button(PC_13); 00007 00008 int main() { 00009 while(1) { 00010 if (button==0) { 00011 m1.speed(0.6); 00012 m2.speed(0.6); 00013 wait(2); 00014 m1.speed(-0.6); 00015 m2.speed(-0.6); 00016 wait(2); 00017 } 00018 else { 00019 m1.speed(0); 00020 m2.speed(0); 00021 } 00022 } 00023 }
Generated on Mon Jul 18 2022 11:41:27 by
1.7.2