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.
main.cpp
- Committer:
- kinga
- Date:
- 2017-02-08
- Revision:
- 0:839533b03cb9
File content as of revision 0:839533b03cb9:
#include "MicroBit.h"
MicroBit uBit;
MicroBitSerial serial(USBTX, USBRX);
MicroBitI2C i2c(I2C_SDA0, I2C_SCL0);
MicroBitAccelerometer accelerometer(i2c);
MicroBitStorage storage;
MicroBitCompass compass(i2c, accelerometer, storage);
int main()
{
uBit.init();
while (1) {
int heading = compass.heading();
serial.send((ManagedString)heading);
uBit.sleep(500);
}
release_fiber();
}