Colin Stearns
/
qcControl
QC Control software
Fork of dgps by
handle/handleCompass.cpp@10:c4745ddaaf6a, 2014-04-03 (annotated)
- Committer:
- krobertson
- Date:
- Thu Apr 03 17:24:53 2014 +0000
- Revision:
- 10:c4745ddaaf6a
- Child:
- 44:2ae602b89961
added compass
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 | 10:c4745ddaaf6a | 3 | compassHandle::compassHandle(){ |
krobertson | 10:c4745ddaaf6a | 4 | heading = 0; |
krobertson | 10:c4745ddaaf6a | 5 | setup(); |
krobertson | 10:c4745ddaaf6a | 6 | } |
krobertson | 10:c4745ddaaf6a | 7 | |
krobertson | 10:c4745ddaaf6a | 8 | void compassHandle::setup(){ |
krobertson | 10:c4745ddaaf6a | 9 | compass.init(); |
krobertson | 10:c4745ddaaf6a | 10 | compass.enableDefault(); |
krobertson | 10:c4745ddaaf6a | 11 | } |
krobertson | 10:c4745ddaaf6a | 12 | |
krobertson | 10:c4745ddaaf6a | 13 | void compassHandle::run(){ |
krobertson | 10:c4745ddaaf6a | 14 | compass.read(); |
krobertson | 10:c4745ddaaf6a | 15 | heading = compass.get_heading(); |
krobertson | 10:c4745ddaaf6a | 16 | } |