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 HMC5883L_kai_3
main.cpp
- Committer:
- imanomadao
- Date:
- 2020-02-24
- Revision:
- 3:8b34748c199c
- Parent:
- 2:2ce6c35efc65
File content as of revision 3:8b34748c199c:
#include "mbed.h" #include "HMC5883L.h" HMC5883L compass(PB_9, PB_8); RawSerial pc(USBTX, USBRX, 9600); int main(){ int16_t a[3]; double b; /*while(1){ compass.init(); b= compass.getHeadingXYDeg(-152,286); printf("%lf\r\n",b); wait(1); // wait(0.); }*/ compass.init(); wait_ms(10); while(1){ compass.getXYZ(a); pc.printf("x=%d, y=%d, z=%d,\r\n",a[0],a[2],a[1]); b= compass.getHeadingXYDeg(-152,286); pc.printf("%lf\r\n",b); //printf("%d, %d\r\n",a[0]+20,a[2]+50); wait(1); } //} }