CMPS03 digital compass example.

Dependencies:   mbed CMPS03

main.cpp

Committer:
aberk
Date:
2010-08-26
Revision:
0:83650aeac2b2

File content as of revision 0:83650aeac2b2:

#include "CMPS03.h"

CMPS03 compass(p9, p10, CMPS03_DEFAULT_I2C_ADDRESS);
Serial pc(USBTX, USBRX);

int main() {

    pc.printf("Starting CMPS03 test...\n");

    while(1){
        
        wait(0.1);
        
        pc.printf("Bearing is: %f\n", compass.readBearing() / 10.0);
    
    }

}