Regenerating PPM signal based on distances from ultrasonic sensors, ESP8266 for connectin via wifi. Autonomous quadcopter behaviour, autonomou height holding. Flying direction based on front and back ultrasonic sensors.

Dependencies:   ConfigFile HCSR04 PID PPM2 mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers definitions.h Source File

definitions.h

00001 /*
00002     NVIC_SetPriority(TIMER0_IRQn, 0);
00003     NVIC_SetPriority(TIMER1_IRQn, 1);
00004     NVIC_SetPriority(TIMER2_IRQn, 2);
00005     NVIC_SetPriority(TIMER3_IRQn, 3);
00006 */
00007 
00008 #define PIEZZO_START 0.1
00009 #define PIEZZO_STOP 0.0
00010 #define CHANNELS 8
00011 
00012 #define ROLL 0
00013 #define PITCH 1
00014 #define THROTTLE 2   
00015 #define YAW 3
00016 #define AUX1 4
00017 #define AUX2 5
00018 
00019 #define THROTTLE_LIMIT  1500
00020 #define PITCH_MOVE_FORWARD      15
00021 #define PITCH_MOVE_BACKWARD     15
00022 #define LANDING_HEIGHT  6
00023 
00024 
00025 #define             FLIGHT_CONTROLLER_FREQUENCY 100
00026 
00027 /*
00028 pc.printf("ROLL %d\n\r", channels[ROLL]);
00029 pc.printf("PITCH %d\n\r", channels[PITCH]);
00030 pc.printf("YAW %d\n\r", channels[YAW]);
00031 pc.printf("THROTTLE %d\n\r", channels[THROTTLE]);
00032 pc.printf("AUX1 %d\n\r", channels[AUX1]);
00033 pc.printf("AUX2 %d\n\r", channels[AUX2]);
00034 
00035 */