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 // Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0) 00002 00003 #include "mbed.h" 00004 #include "Motor.h" 00005 Motor m1(p21, p19, p20); // pwm, fwd, rev 00006 Motor m2(p22, p16, p15); // pwm, fwd, rev 00007 00008 int main() { 00009 while(1){ 00010 m1.speed(.4); 00011 m2.speed(.4); 00012 wait(1); 00013 m1.speed(0); 00014 m2.speed(0); 00015 wait(1); 00016 m1.speed(-.4); 00017 m2.speed(-.4); 00018 wait(1); 00019 m1.speed(0); 00020 m2.speed(0); 00021 wait(1); 00022 m1.speed(-.5); 00023 m2.speed(.5); 00024 wait(1.75); 00025 m1.speed(0); 00026 m2.speed(0); 00027 wait(1); 00028 m1.speed(.5); 00029 m2.speed(-.5); 00030 wait(1.75); 00031 m1.speed(0); 00032 m2.speed(0); 00033 wait(1); 00034 00035 } 00036 }
Generated on Fri Aug 19 2022 15:27:04 by
1.7.2