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
- Committer:
- dylanembed123
- Date:
- 2014-05-05
- Revision:
- 66:5d43988d100c
- Parent:
- 49:06721139d298
File content as of revision 66:5d43988d100c:
#include "handleCompass.h"
compassHandle* compassHandle::hand = NULL;
compassHandle::compassHandle(){
heading = 0;
initialized = false;
}
void compassHandle::setup(){
initialized = true;
compass.init();
compass.enableDefault();
}
void compassHandle::run(){
if(!initialized){
setup();
}
compass.read();
heading = compass.get_heading();
USB::getSerial().printf("Compass heading: %f\r\n",heading);
}
