Code to move the position of the base plate of the turret

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
cjedwardz
Date:
Mon Feb 12 16:33:20 2018 +0000
Commit message:
Version 0

Changed in this revision

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 9c87d309ecac main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Feb 12 16:33:20 2018 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+#include "stdio.h"
+
+PwmOut speed(p26);
+DigitalOut fwd(p30);
+// p26 connects to IN1 and determines motor speed
+// p30 connects to IN2 and determines motor direction
+// fwd = 1 gives CW motion, fwd = 0 gives CCW motion
+
+int run = 1;
+
+int main() 
+{
+    speed.period(0.008);
+    
+    while(run == 1) 
+    {
+     speed = 0.5;
+     fwd = 1;
+     wait(5.0);
+     
+     speed = 0;
+     fwd = 0;
+     wait(5.0);
+     
+     speed = .5;
+     fwd = 0;
+     wait(5.0);
+     
+     speed = 0;
+     fwd = 0;
+     wait(5.0);
+     
+     run = 0;
+    }
+}
diff -r 000000000000 -r 9c87d309ecac mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Feb 12 16:33:20 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file