Colin Stearns
/
qcControl
QC Control software
Fork of dgps by
handle/handleCompass.cpp@49:06721139d298, 2014-04-26 (annotated)
- Committer:
- krobertson
- Date:
- Sat Apr 26 04:14:18 2014 +0000
- Revision:
- 49:06721139d298
- Parent:
- 44:2ae602b89961
- Child:
- 66:5d43988d100c
minor changes involving output for debugging. I need to pull and this software screws up when I do
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
krobertson | 10:c4745ddaaf6a | 1 | #include "handleCompass.h" |
krobertson | 10:c4745ddaaf6a | 2 | |
krobertson | 44:2ae602b89961 | 3 | compassHandle* compassHandle::hand = NULL; |
krobertson | 44:2ae602b89961 | 4 | |
krobertson | 10:c4745ddaaf6a | 5 | compassHandle::compassHandle(){ |
krobertson | 10:c4745ddaaf6a | 6 | heading = 0; |
krobertson | 44:2ae602b89961 | 7 | initialized = false; |
krobertson | 10:c4745ddaaf6a | 8 | } |
krobertson | 10:c4745ddaaf6a | 9 | |
krobertson | 10:c4745ddaaf6a | 10 | void compassHandle::setup(){ |
krobertson | 44:2ae602b89961 | 11 | initialized = true; |
krobertson | 10:c4745ddaaf6a | 12 | compass.init(); |
krobertson | 10:c4745ddaaf6a | 13 | compass.enableDefault(); |
krobertson | 10:c4745ddaaf6a | 14 | } |
krobertson | 10:c4745ddaaf6a | 15 | |
krobertson | 10:c4745ddaaf6a | 16 | void compassHandle::run(){ |
krobertson | 44:2ae602b89961 | 17 | if(!initialized){ |
krobertson | 44:2ae602b89961 | 18 | setup(); |
krobertson | 44:2ae602b89961 | 19 | } |
krobertson | 10:c4745ddaaf6a | 20 | compass.read(); |
krobertson | 10:c4745ddaaf6a | 21 | heading = compass.get_heading(); |
krobertson | 49:06721139d298 | 22 | //USB::getSerial().printf("Compass heading: %f\r\n",heading); |
krobertson | 10:c4745ddaaf6a | 23 | } |