Hepta 9axis Sensor(Gyroscope)

Dependencies:   mbed HeptaBattery Hepta9axis

Fork of Lab7-01_template by HEPTA-Sat Training 2017~2018

Committer:
HEPTA
Date:
Mon Aug 19 05:40:25 2019 +0000
Revision:
17:e4a3f3d5ee58
Parent:
16:c238ef7aa7e5
Child:
19:4233988b4951

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:bdbd3d6fc5d5 1 #include "mbed.h"
HEPTA 16:c238ef7aa7e5 2 #include "HeptaBattery.h"
umeume 2:1c5cdb2c3e0f 3 #include "Hepta9axis.h"
HEPTA 16:c238ef7aa7e5 4 Serial pc(USBTX,USBRX);
HEPTA 16:c238ef7aa7e5 5 HeptaBattery battery(p19,p26);
HEPTA 16:c238ef7aa7e5 6 Hepta9axis n_axis(p28,p27,0xD0,0x18);
umeume 2:1c5cdb2c3e0f 7
umeume 2:1c5cdb2c3e0f 8 int main()
umeume 2:1c5cdb2c3e0f 9 {
HEPTA 14:ebe9ec72b3e2 10 pc.baud(9600);
HEPTA 14:ebe9ec72b3e2 11 float gx,gy,gz;
HEPTA 14:ebe9ec72b3e2 12 pc.printf("Gyro Sensor Mode\r\n");
HEPTA 14:ebe9ec72b3e2 13 for(int i = 0; i<50; i++) {
HEPTA 14:ebe9ec72b3e2 14 n_axis.sen_gyro(&gx,&gy,&gz);
HEPTA 14:ebe9ec72b3e2 15 pc.printf("%f,%f,%f\r\n",gx,gy,gz);
HEPTA 14:ebe9ec72b3e2 16 wait(1.0);
HEPTA 14:ebe9ec72b3e2 17 }
umeume 2:1c5cdb2c3e0f 18 }