Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of dgps by
handle/handleCompass.cpp@17:323fc40376d5, 2014-04-03 (annotated)
- Committer:
- krobertson
- Date:
- Thu Apr 03 17:18:58 2014 +0000
- Revision:
- 17:323fc40376d5
added compass to project
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| krobertson | 17:323fc40376d5 | 1 | #include "handleCompass.h" |
| krobertson | 17:323fc40376d5 | 2 | |
| krobertson | 17:323fc40376d5 | 3 | compassHandle::compassHandle(){ |
| krobertson | 17:323fc40376d5 | 4 | heading = 0; |
| krobertson | 17:323fc40376d5 | 5 | setup(); |
| krobertson | 17:323fc40376d5 | 6 | } |
| krobertson | 17:323fc40376d5 | 7 | |
| krobertson | 17:323fc40376d5 | 8 | compassHandle::setup(){ |
| krobertson | 17:323fc40376d5 | 9 | compass.init(); |
| krobertson | 17:323fc40376d5 | 10 | compass.enableDefault(); |
| krobertson | 17:323fc40376d5 | 11 | } |
| krobertson | 17:323fc40376d5 | 12 | |
| krobertson | 17:323fc40376d5 | 13 | compassHandle::run(){ |
| krobertson | 17:323fc40376d5 | 14 | compass.read(); |
| krobertson | 17:323fc40376d5 | 15 | heading = compass.get_heading(); |
| krobertson | 17:323fc40376d5 | 16 | } |
