Raharja Agie / Mbed 2 deprecated Controller

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "struct.h"
00003 
00004 short test, test1;
00005 
00006 #include "i2c.h"
00007 #include "rc.h"
00008 #include "setup.h"
00009 #include "2gcs.h"
00010 #include "ahrs.h"
00011 
00012     
00013 int main() {
00014     setup();
00015     //SendData.attach(&toGCS, 0.02777);
00016     //Proccess.attach(&eyetosee, 0.1);     
00017     ahrs.attach(&ahrs_rec);       
00018     rc.rise(&PPM_rise);    // attach the address of the PPM_rise function to the rising edge
00019     
00020     while(1) {           // wait around, interrupts will interrupt this!
00021         printf("%d\t", RC.roll);
00022         printf("%d\t", RC.throttle);
00023         printf("%d\t", RC.pitch);
00024         printf("%d\t", RC.yaw);
00025         printf("%d\n", RC.sw);
00026         wait(0.02);
00027         //for(char i=0; i<6; i++){
00028         //  printf("%d\t", buf_ppm[i]);
00029         //  bl_L[1]= abs(test - test1);
00030         //  if(buf_ppm[i] > 5000) printf("%d\t%d\t%d\n", test, test1, bl_L[1]); //("%d\t%d\n", buf_ppm[i], i);          
00031         //    wait(0.02);
00032         //    }      
00033     }
00034 }