MAKOTO MOTOYAMA / Mbed 2 deprecated Lab4-07_detect_geomagnetic

Dependencies:   HEPTA_SENSOR mbed HEPTA_EPS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "HEPTA_EPS.h"
00003 #include "HEPTA_SENSOR.h"
00004  
00005 Serial pc(USBTX, USBRX);
00006 HEPTA_EPS eps(p16,p26);
00007 HEPTA_SENSOR sensor(p17, 
00008                     p28,p27,0x19,0x69,0x13,
00009                     p13,p14,p25,p24);
00010 
00011 int main()
00012 {
00013     pc.baud(9600);
00014     float mx,my,mz;
00015     pc.printf("Magnetometer Mode\r\n");
00016     for(int i = 0; i<50; i++) {
00017         sensor.sen_mag(&mx,&my,&mz);
00018         pc.printf("%f,%f,%f\r\n",mx,my,mz);
00019         wait(1.0);
00020     }
00021 }