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.
Dependencies: mbed CROTUS_XBee mbed-rtos Crotus_Com
main.cpp
- Committer:
- libv2001
- Date:
- 2017-03-14
- Revision:
- 1:3591e7df4ff4
- Parent:
- 0:28d5622d1a3e
- Child:
- 3:39b24d902aa7
File content as of revision 1:3591e7df4ff4:
#include "mbed.h" #include "Magneto.h" #include "Acc.h" DigitalOut myled(LED1); I2C i2c(p28, p27); Magneto magneto(i2c); Acc acc(i2c); Serial pc(USBTX, USBRX); int main() { if(!magneto.TestDeviceConnection() || !acc.TestDeviceConnection()){ pc.printf("SCRUB!!\r\n"); return -1; } magneto.ActivateDevice(); acc.ActivateDevice(); wait(0.2); while(true){ int16_t heading = magneto.GetHeadingXY(); int16_t inclination = acc.GetInclinationYZ(); pc.printf("Heading : %d, Inclination : %d\r\n", heading, inclination); wait(0.1); } }