Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:3137e34fc9fa
- Child:
- 1:5c6888eb051a
diff -r 000000000000 -r 3137e34fc9fa main.cpp
--- /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
+
+
+
+ */
+ }
+}