glider code
Dependencies: BMP180 Glider HMC5883L mbed-os beep
main.cpp@11:7fbf4bee8472, 2017-04-24 (annotated)
- Committer:
- chasefarmer2808
- Date:
- Mon Apr 24 21:34:20 2017 +0000
- Revision:
- 11:7fbf4bee8472
- Parent:
- 10:b2037c57ea5b
- Child:
- 14:f49ac8f6ed3a
accurate
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chasefarmer2808 | 0:db9e6e5a082b | 1 | #include "Glider.h" |
chasefarmer2808 | 0:db9e6e5a082b | 2 | |
chasefarmer2808 | 0:db9e6e5a082b | 3 | Serial pc(USBTX, USBRX); |
chasefarmer2808 | 3:8bdb55e85c85 | 4 | LocalFileSystem local("telem"); |
chasefarmer2808 | 5:b2b6de73d542 | 5 | Ticker transmitTimer; |
chasefarmer2808 | 0:db9e6e5a082b | 6 | |
chasefarmer2808 | 4:a5d4b62240ba | 7 | int main() { |
chasefarmer2808 | 1:477c993d97fa | 8 | Glider g(&pc, p28, p27, p9, p10); |
chasefarmer2808 | 6:c62b5e2124d6 | 9 | transmitTimer.attach(&g, &Glider::setTransmitFlag, FREQ); |
chasefarmer2808 | 4:a5d4b62240ba | 10 | |
chasefarmer2808 | 0:db9e6e5a082b | 11 | while (1) { |
chasefarmer2808 | 9:24dd76917236 | 12 | |
chasefarmer2808 | 5:b2b6de73d542 | 13 | g.setHeading(); |
chasefarmer2808 | 9:24dd76917236 | 14 | g.setTempPressAlt(); |
chasefarmer2808 | 10:b2037c57ea5b | 15 | g.setAirSpeed(); |
chasefarmer2808 | 4:a5d4b62240ba | 16 | g.setMissionTime(); |
chasefarmer2808 | 11:7fbf4bee8472 | 17 | //g.saveData(); |
chasefarmer2808 | 5:b2b6de73d542 | 18 | |
chasefarmer2808 | 5:b2b6de73d542 | 19 | if (g.transmitFlag) { |
chasefarmer2808 | 11:7fbf4bee8472 | 20 | g.saveData(); |
chasefarmer2808 | 5:b2b6de73d542 | 21 | g.transmitPacket(); |
chasefarmer2808 | 5:b2b6de73d542 | 22 | g.transmitFlag = false; |
chasefarmer2808 | 5:b2b6de73d542 | 23 | } |
chasefarmer2808 | 9:24dd76917236 | 24 | //pc.printf("heading: %f\r\n", g.heading); |
chasefarmer2808 | 9:24dd76917236 | 25 | g.processCommand(); |
chasefarmer2808 | 0:db9e6e5a082b | 26 | //g.saveTelem(); |
chasefarmer2808 | 3:8bdb55e85c85 | 27 | |
chasefarmer2808 | 3:8bdb55e85c85 | 28 | //pc.printf("%d\r\n", g.missionTime); |
chasefarmer2808 | 3:8bdb55e85c85 | 29 | /* |
chasefarmer2808 | 0:db9e6e5a082b | 30 | pc.printf("heading: %f\r\n", g.heading); |
chasefarmer2808 | 0:db9e6e5a082b | 31 | pc.printf("pressure: %f\r\n", g.pressure); |
chasefarmer2808 | 0:db9e6e5a082b | 32 | pc.printf("temp: %f\r\n", g.temp); |
chasefarmer2808 | 0:db9e6e5a082b | 33 | pc.printf("alt: %f\r\n", g.alt); |
chasefarmer2808 | 1:477c993d97fa | 34 | g.xbee->printf("hello\r\n"); |
chasefarmer2808 | 3:8bdb55e85c85 | 35 | */ |
chasefarmer2808 | 5:b2b6de73d542 | 36 | //wait(1); |
chasefarmer2808 | 0:db9e6e5a082b | 37 | } |
chasefarmer2808 | 0:db9e6e5a082b | 38 | |
chasefarmer2808 | 0:db9e6e5a082b | 39 | } |
chasefarmer2808 | 0:db9e6e5a082b | 40 |