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
Diff: hardware.h
- Branch:
- DistanceRegulation
- Revision:
- 40:0aa1cefe80ab
- Parent:
- 39:93d8aa47f4ce
- Child:
- 41:5fe200d20022
diff -r 93d8aa47f4ce -r 0aa1cefe80ab hardware.h --- a/hardware.h Sun Mar 25 12:57:04 2018 +0000 +++ b/hardware.h Tue May 15 10:34:35 2018 +0000 @@ -18,15 +18,22 @@ PID* _groundDistance; //RtosTimer *_groudRegulationUpdateTimer; HCSR04* _sonic; -uint32_t _frontDistance; +uint8_t _frontDistance; +uint8_t _leftDistance; +uint8_t _rightDistance; +uint8_t _backDistance; PpmRegen* _ppmRegen; ConfigFile _configFile; LocalFileSystem local("local"); -Thread _serverThread; -Thread _frontSensorThread; -Thread *_distanceThread; +Semaphore _semaphore(1); +Thread _serverThread; +Thread _frontSensorThread; +Thread _leftSensorThread; +Thread _rightSensorThread; +Thread _backSensorThread; +Thread *_distanceThread; InterruptIn* _interruptPort = new InterruptIn(p28); @@ -58,6 +65,7 @@ float _newGroundSetPoint; bool _tempGroundRegulation = false; bool _goAhead = false; +bool _frontWall = false;