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 m(p25,p27,p28); 00005 DigitalIn switch1(p18); 00006 DigitalIn switch2(p19); 00007 float speed=0.0; 00008 00009 int main() { 00010 while(1){ 00011 if (switch1==1 && switch2 == 0) { 00012 m.speed(speed); //the speed equals 00013 speed = 1.0; 00014 printf("Let's get this bread\n\r"); } 00015 else if (switch2==1 && switch1 == 0) { 00016 m.speed(speed); 00017 speed = -1.0; 00018 printf("Let's get this bread in reverse\n\r"); } 00019 else if (switch1==1 && switch2==1) { 00020 m.speed(speed); 00021 speed = 0.0; 00022 printf("BEEP BOOP BOP BEEP DOES NOT COMPUTE\n\r"); } 00023 00024 else (switch1 == 0 && switch2==0);{ 00025 m.speed(speed); 00026 speed = 0.0; 00027 printf("BEEP BOOP BOP BEEP DOES NOT COMPUTE\n\r"); } 00028 00029 00030 } 00031 } 00032 00033 00034 00035 00036 00037 00038 00039
Generated on Fri Jul 22 2022 05:15:05 by
1.7.2