A litttle pwm and motorprogram to show how libaryswork

Dependencies:   mbed Motor

Files at this revision

API Documentation at this revision

Comitter:
moba
Date:
Wed Nov 24 21:15:15 2010 +0000
Commit message:

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 d2bac1ae4460 Motor.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Motor.lib	Wed Nov 24 21:15:15 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Motor/#f265e441bcd9
diff -r 000000000000 -r d2bac1ae4460 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Nov 24 21:15:15 2010 +0000
@@ -0,0 +1,42 @@
+// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0)
+
+#include "mbed.h"
+#include "Motor.h"
+
+Motor m1(p23, p6, p5); // pwm, fwd, rev
+PwmOut led1(LED1);
+PwmOut led2(LED2);
+int main() {
+Serial pc(USBTX, USBRX);
+
+    while (1) {
+        led2 = 1-led1;
+        led1 = led1 + 0.01;
+        wait(0.02);
+        if (led1 == 1.0) {
+            led1 = 0;
+        }
+        if (led2 == 0) {
+            led2 = 1,0;
+        }
+        
+{
+//r (float s= -1.0; s < 1.0 ; s += 0.01) {
+     m1.speed(s); 
+float s=0.45
+
+    }
+
+
+
+pc.printf("Hallo");
+
+
+
+
+
+
+   
+    }
+     }
+   
\ No newline at end of file
diff -r 000000000000 -r d2bac1ae4460 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 24 21:15:15 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e