This is for ICRS\' second generation Quadcopter

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main_init.h Source File

main_init.h

00001 
00002 
00003 void main_init() {
00004 
00005     //Emergency stop button
00006     Nkill.mode(PullDown);
00007 
00008     pc.printf("Hello World!\r\n");
00009 
00010     initmotor();
00011 
00012     /*
00013     //Init motor pwm
00014     left.period_ms(20);
00015     left = 0.01;
00016     right.period_ms(20);
00017     right = 0.01;
00018 
00019     front.period_ms(20);
00020     front = 0.01;
00021     rear.period_ms(20);
00022     rear = 0.01;
00023     */
00024 
00025     pc.printf("Motors initialized\r\n");
00026 
00027     //Setup accelerometer
00028     setupaccel();
00029     pc.printf("Accelorometer initialized\r\n");
00030 
00031     //Setup gyros, and calibrate them
00032     wait(0.5);
00033     calibgyro();
00034     pc.printf("Gyros initialized and calibrated\r\n");
00035 
00036 }