configuration de l\'IMU chr-um6 via le Mbed

Dependencies:   mbed

main.cpp

Committer:
belloula
Date:
2011-10-21
Revision:
0:9aa10932bd4f
Child:
1:805f3ddb2ee5

File content as of revision 0:9aa10932bd4f:

#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); 
        }
}