Hepta 9axis Sensor(Gyroscope)

Dependencies:   mbed HeptaBattery Hepta9axis

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

Committer:
HEPTA
Date:
Sat Aug 17 08:51:09 2019 +0000
Revision:
15:1d9772c3fe72
Parent:
14:ebe9ec72b3e2
Child:
16:c238ef7aa7e5
Added sentence to make EN pin high

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:bdbd3d6fc5d5 1 #include "mbed.h"
umeume 2:1c5cdb2c3e0f 2 #include "Hepta9axis.h"
umeume 2:1c5cdb2c3e0f 3
umeume 2:1c5cdb2c3e0f 4 Serial pc(USBTX,USBRX);
HEPTA 10:4d6870d0caa0 5 Hepta9axis n_axis(p28,p27,0xD0,0x18);
HEPTA 15:1d9772c3fe72 6 DigitalOut EN(p26);
umeume 2:1c5cdb2c3e0f 7 int main()
umeume 2:1c5cdb2c3e0f 8 {
HEPTA 15:1d9772c3fe72 9 EN = 1; // EN pin : high
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 }