Aaron Berk
/
CMPS03_HelloWorld
CMPS03 digital compass example.
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "CMPS03.h" 00002 00003 CMPS03 compass(p9, p10, CMPS03_DEFAULT_I2C_ADDRESS); 00004 Serial pc(USBTX, USBRX); 00005 00006 int main() { 00007 00008 pc.printf("Starting CMPS03 test...\n"); 00009 00010 while(1){ 00011 00012 wait(0.1); 00013 00014 pc.printf("Bearing is: %f\n", compass.readBearing() / 10.0); 00015 00016 } 00017 00018 }
Generated on Tue Jul 12 2022 11:37:21 by 1.7.2