Fa2018-es200-1121-proj2-Clang&Bang / Mbed 2 deprecated Project2motor

Dependencies:   Motor mbed

Files at this revision

API Documentation at this revision

Comitter:
EvanKlatt
Date:
Tue Oct 09 12:05:06 2018 +0000
Commit message:
Final Motor Code

Changed in this revision

Motor.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 60942e02493f Motor.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motor.lib	Tue Oct 09 12:05:06 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/Motor/#f265e441bcd9
diff -r 000000000000 -r 60942e02493f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 09 12:05:06 2018 +0000
@@ -0,0 +1,39 @@
+#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");  }
+        
+        
+        }
+}
+    
+
+
+
+
+
+
+
diff -r 000000000000 -r 60942e02493f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 09 12:05:06 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file