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

definitions.h

Committer:
edy05
Date:
2018-05-22
Branch:
DistanceRegulation
Revision:
41:5fe200d20022
Parent:
40:0aa1cefe80ab

File content as of revision 41:5fe200d20022:

/*
    NVIC_SetPriority(TIMER0_IRQn, 0);
    NVIC_SetPriority(TIMER1_IRQn, 1);
    NVIC_SetPriority(TIMER2_IRQn, 2);
    NVIC_SetPriority(TIMER3_IRQn, 3);
*/

#define PIEZZO_START 0.1
#define PIEZZO_STOP 0.0
#define CHANNELS 8

#define ROLL 0
#define PITCH 1
#define THROTTLE 2   
#define YAW 3
#define AUX1 4
#define AUX2 5

#define THROTTLE_LIMIT  1500
#define PITCH_MOVE_FORWARD      15
#define PITCH_MOVE_BACKWARD     15
#define LANDING_HEIGHT  6


#define             FLIGHT_CONTROLLER_FREQUENCY 100

/*
pc.printf("ROLL %d\n\r", channels[ROLL]);
pc.printf("PITCH %d\n\r", channels[PITCH]);
pc.printf("YAW %d\n\r", channels[YAW]);
pc.printf("THROTTLE %d\n\r", channels[THROTTLE]);
pc.printf("AUX1 %d\n\r", channels[AUX1]);
pc.printf("AUX2 %d\n\r", channels[AUX2]);

*/