Quadcopter software. Flying - Contact me for more details or a copy of the PC ground station code
Dependencies: ConfigFile PID PPM MODSERIAL mbed-rtos mbed MaxbotixDriver TinyGPS filter
altitudeMonitor.h@9:7b194f83e567, 2015-02-22 (annotated)
- Committer:
- joe4465
- Date:
- Sun Feb 22 20:10:12 2015 +0000
- Revision:
- 9:7b194f83e567
Added external magnetometer
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joe4465 | 9:7b194f83e567 | 1 | #include "mbed.h" |
joe4465 | 9:7b194f83e567 | 2 | #include "rtos.h" |
joe4465 | 9:7b194f83e567 | 3 | #include "hardware.h" |
joe4465 | 9:7b194f83e567 | 4 | |
joe4465 | 9:7b194f83e567 | 5 | // The altitude monitor thread gets the latest altitude from each sensor and combines into one altitude |
joe4465 | 9:7b194f83e567 | 6 | void AltitudeMonitorThread(void const *args) |
joe4465 | 9:7b194f83e567 | 7 | { |
joe4465 | 9:7b194f83e567 | 8 | printf("Altitude monitor thread started\r\n"); |
joe4465 | 9:7b194f83e567 | 9 | |
joe4465 | 9:7b194f83e567 | 10 | while (true) |
joe4465 | 9:7b194f83e567 | 11 | { |
joe4465 | 9:7b194f83e567 | 12 | _maxBotixPingAltitude = _maxBotixSensor.read() / 100; // Convert to meters |
joe4465 | 9:7b194f83e567 | 13 | _barometerAltitude = 0;//_freeIMU.getBaroAlt(); |
joe4465 | 9:7b194f83e567 | 14 | |
joe4465 | 9:7b194f83e567 | 15 | |
joe4465 | 9:7b194f83e567 | 16 | Thread::wait(100); |
joe4465 | 9:7b194f83e567 | 17 | } |
joe4465 | 9:7b194f83e567 | 18 | } |