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 HeptaBattery Hepta9axis
Fork of Lab7-01_template by
main.cpp
- Committer:
- HEPTA
- Date:
- 2019-08-19
- Revision:
- 18:748c13c8a567
- Parent:
- 16:9dc19bd7b8ff
File content as of revision 18:748c13c8a567:
#include "mbed.h"
#include "Hepta9axis.h"
#include "HeptaBattery.h"
Serial pc(USBTX,USBRX);
Hepta9axis n_axis(p28,p27,0xD0,0x18);
HeptaBattery battery(p16,p26);
int main()
{
    pc.baud(9600);
    float mx,my,mz;
    pc.printf("Magnetometer Mode\r\n");
    for(int i = 0; i<50; i++) {
        n_axis.sen_mag(&mx,&my,&mz);
        pc.printf("%f,%f,%f\r\n",mx,my,mz);
        wait(1.0);
    }
}
            
    