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 "Servo.h" 00003 00004 DigitalOut myled(LED2); 00005 Servo motor (p21); 00006 00007 int main() { 00008 00009 int b = 0; 00010 00011 while (b !=2 ){ 00012 00013 motor.write(0.5); 00014 wait(3); 00015 00016 motor.write(0); //full forward 00017 wait(1); 00018 motor.write(0.5); 00019 wait(1); 00020 myled = 1; 00021 00022 wait(2); 00023 00024 motor.write(0.88); //full bacward 00025 wait(5); 00026 motor.write(0.5); 00027 wait(1); 00028 myled = 0; 00029 00030 b = 2; 00031 } 00032 00033 while(1) {//FIN 00034 myled = 1; 00035 wait(0.2); 00036 myled = 0; 00037 wait(0.2); 00038 } 00039 }
Generated on Wed Jul 13 2022 20:43:39 by
1.7.2