part1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
shibulal
Date:
Thu Oct 08 17:52:54 2015 +0000
Commit message:
lab3part1; ;

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 ef586a6b33e5 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 08 17:52:54 2015 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+
+PwmOut servo1(p26);
+PwmOut servo2(p25);
+PwmOut dcMotor(p24);
+DigitalOut out1(p18);
+DigitalOut out2(p19);
+DigitalIn in1(p14);
+DigitalIn in2(p15);
+DigitalIn in3(p16);
+DigitalIn in4(p17);
+Serial pc(USBTX, USBRX);
+
+int main() {
+    
+    
+    servo1.period(0.02);
+    servo2.period(0.02);
+    servo1.pulsewidth(0.00225);                                                                                                                                                                                                                                                                                                                  
+    servo2.pulsewidth(0.00075);
+    dcMotor.period(0.02f);
+    dcMotor.write(0.5f);
+    out2=1.0f;
+    out1=0.0f;
+    while(1) {
+        if (in1){
+            servo2.period(0.02f);
+            servo2.pulsewidth(0.00075);
+            }
+    }
+}
diff -r 000000000000 -r ef586a6b33e5 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 08 17:52:54 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file