![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
configuration de l\'IMU chr-um6 via le Mbed
Diff: main.cpp
- Revision:
- 0:9aa10932bd4f
- Child:
- 1:805f3ddb2ee5
diff -r 000000000000 -r 9aa10932bd4f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 21 15:05:55 2011 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" +//conecte imu to pc via xbee to calibrate imu via "AHRSInterfacex86" soft +Serial pc(USBTX, USBRX); +DigitalOut myled(LED1); +Serial xbee(p9, p10); +DigitalOut rst1(p11); +Serial imu(p13, p14); + +void fxbee() +{ + while(xbee.readable()) + { + imu.putc(xbee.getc()); + } +} + +void fimu() +{ + while(imu.readable()) + { + xbee.putc(imu.getc()); + } +} + +int main() +{ + xbee.baud(115200); + imu.baud(115200); + + imu.attach(fimu); + xbee.attach(fxbee); + //reset xbee module + rst1 = 0; + wait_ms(1); + rst1 = 1; + wait_ms(1); + + + while(1) + + { + myled = 0; + wait_ms(500); + myled = 1; + wait_ms(500); + } +} \ No newline at end of file