test program

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
lokitsyu
Date:
Thu Jun 20 20:08:32 2013 +0000
Child:
1:5c6888eb051a
Commit message:
this is not good

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jun 20 20:08:32 2013 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+#include "rtos.h"
+
+
+Interrupt unit(p8);
+
+DigitalOut motors[4] = {
+    DigitalOut(p21),DigitalOut(p22),DigitalOut(p23), DigitalOut(p24)
+};
+
+void get_gyro(){}
+
+//motor drive control funciton
+void motordrv(void const *n, int outval){
+    motors[(int)n] = 1;
+    void wait_us(1000 + outval);
+    motors[(int)n] = 0;
+}
+
+
+
+//main function
+int main() {
+    unit.fall(&get_gyro)
+    
+    RtosTimer drv_1_timer(motordrv, osTimerPeriodic, (void *)0);
+    RtosTimer drv_2_timer(motordrv, osTimerPeriodic, (void *)1);
+    RtosTimer drv_3_timer(motordrv, osTimerPeriodic, (void *)2);
+    RtosTimer drv_4_timer(motordrv, osTimerPeriodic, (void *)3);
+    
+    drv_1_timer.start(20);
+    drv_2_timer.start(20);
+    drv_3_timer.start(20);
+    drv_4_timer.start(20);
+    
+    
+    //main loop
+    while(1) {
+    /*
+    
+    
+    Write Program on This Space
+    
+    
+    
+    */    
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Thu Jun 20 20:08:32 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58b30ac3f00e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jun 20 20:08:32 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file