Read IMU data at Serial port (p28, p27), data rate <100Hz @115200bps Read 5 channels PPM signal at p11 using InterruptIn Send data via RF Modem at serial port (p13, p14) in 36Hz @115200 Drive i2C motor speed controller at I2C port (p9, p10) in every 10mS (control loop delay time)
Diff: main.cpp
- Revision:
- 0:7ccd56e1c3b1
diff -r 000000000000 -r 7ccd56e1c3b1 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Aug 11 01:23:42 2010 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "Set_up.h" +#include "data_struct.h" +#include "ahrs.h" +#include "to_gcs.h" +#include "i2C.h" +#include "rcrx.h" + +int main() { + setup(); + SendData.attach(&toGCS, 0.02777); + Proccess.attach(&eyetosee, 0.1); + ahrs.attach(&ahrs_rec); + rc.rise(&PPM_rise); // attach the address of the PPM_rise function to the rising edge + rc.fall(&PPM_fall); // attach the address of the PPM_fall function to the falling edge + wait(0.5); + + while(1) { + eyetosee(); + myled = !myled; + for(char i=0; i<6; i++){ + printf("%d\t", buf_ppm[i]); + if(i == 5) printf("\n"); + wait(0.02); + } + } +} \ No newline at end of file