Collaboration Coding Test

Dependencies:   mbed

/media/uploads/Incursion4life/mbed.bld /media/uploads/Incursion4life/main.cpp

Files at this revision

API Documentation at this revision

Comitter:
Incursion4life
Date:
Wed Aug 27 22:01:48 2014 +0000
Parent:
2:5ce692cfe5c8
Commit message:
New motor Script

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
sMotor.lib Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 27 22:01:48 2014 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+DigitalOut IN1(p21);
+DigitalOut IN2(p22);
+DigitalOut IN3(p23);
+DigitalOut IN4(p24);
+
+int main() {
+    IN1=0;
+    IN2=0;
+    IN3=0;
+    IN4=0;
+    wait(200);
+    while (1) {   
+        for(int i=0;i<3;i++){
+            wait(200); 
+            if(i>3){i=0;}
+            switch(i){
+                case 0:
+                IN1=1;
+                IN2=0;
+                IN3=1;
+                IN4=0;
+                case 1:
+                IN1=0;
+                IN2=1;
+                IN3=1;
+                IN4=0;
+                
+                case 3:
+                IN1=0;
+                IN2=1;
+                IN3=0;
+                IN4=1;
+                case 4:
+                IN1=1;
+                IN2=0;
+                IN3=0;
+                IN4=1;
+                }
+                }
+                
+    }
+}
\ No newline at end of file
--- a/sMotor.lib	Wed Aug 27 19:13:56 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/XtaticO/code/sMotor/#ba01597e6ed3