Hepta 9axis Sensor(Accelerometer)

Dependencies:   mbed HeptaBattery Hepta9axis

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

Committer:
HEPTA
Date:
Sat Aug 17 08:43:36 2019 +0000
Revision:
15:53779160ad9d
Parent:
14:8d870350014c
Child:
16:f268c8b3e1aa
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:53779160ad9d 6 DigitalOut EN(p26);
umeume 5:c5ccb1b07e8f 7
umeume 2:1c5cdb2c3e0f 8 int main()
umeume 2:1c5cdb2c3e0f 9 {
HEPTA 15:53779160ad9d 10 EN = 1; // EN pin : high
HEPTA 14:8d870350014c 11 pc.baud(9600);
HEPTA 14:8d870350014c 12 float ax,ay,az;
HEPTA 14:8d870350014c 13 pc.printf("Accel Sensor Mode\r\n");
HEPTA 14:8d870350014c 14 for(int i = 0; i<50; i++) {
HEPTA 14:8d870350014c 15 n_axis.sen_acc(&ax,&ay,&az);
HEPTA 14:8d870350014c 16 pc.printf("%f,%f,%f\r\n",ax,ay,az);
HEPTA 14:8d870350014c 17 wait(1.0);
HEPTA 14:8d870350014c 18 }
umeume 2:1c5cdb2c3e0f 19 }