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)

Dependencies:   mbed

main.cpp

Committer:
agiembed
Date:
2010-08-11
Revision:
0:7ccd56e1c3b1

File content as of revision 0:7ccd56e1c3b1:

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