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
- Committer:
- EvanKlatt
- Date:
- 2018-10-09
- Revision:
- 0:60942e02493f
File content as of revision 0:60942e02493f:
#include "mbed.h"
#include "Motor.h"
Motor m(p25,p27,p28);
DigitalIn switch1(p18);
DigitalIn switch2(p19);
float speed=0.0;
int main() {
while(1){
if (switch1==1 && switch2 == 0) {
m.speed(speed); //the speed equals
speed = 1.0;
printf("Let's get this bread\n\r"); }
else if (switch2==1 && switch1 == 0) {
m.speed(speed);
speed = -1.0;
printf("Let's get this bread in reverse\n\r"); }
else if (switch1==1 && switch2==1) {
m.speed(speed);
speed = 0.0;
printf("BEEP BOOP BOP BEEP DOES NOT COMPUTE\n\r"); }
else (switch1 == 0 && switch2==0);{
m.speed(speed);
speed = 0.0;
printf("BEEP BOOP BOP BEEP DOES NOT COMPUTE\n\r"); }
}
}