Hepta 9axis Sensor(Accelerometer)

Dependencies:   mbed HeptaBattery Hepta9axis

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

Committer:
HEPTA
Date:
Mon Aug 19 05:32:42 2019 +0000
Revision:
16:f268c8b3e1aa
Parent:
15:53779160ad9d
Child:
17:8a40733a9d1a

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:bdbd3d6fc5d5 1 #include "mbed.h"
HEPTA 16:f268c8b3e1aa 2 #include "HeptaBattery.h"
umeume 2:1c5cdb2c3e0f 3 #include "Hepta9axis.h"
umeume 2:1c5cdb2c3e0f 4
umeume 2:1c5cdb2c3e0f 5 Serial pc(USBTX,USBRX);
HEPTA 16:f268c8b3e1aa 6 HeptaBattery battery(p19,p26);
HEPTA 10:4d6870d0caa0 7 Hepta9axis n_axis(p28,p27,0xD0,0x18);
umeume 5:c5ccb1b07e8f 8
umeume 2:1c5cdb2c3e0f 9 int main()
umeume 2:1c5cdb2c3e0f 10 {
HEPTA 15:53779160ad9d 11 EN = 1; // EN pin : high
HEPTA 14:8d870350014c 12 pc.baud(9600);
HEPTA 14:8d870350014c 13 float ax,ay,az;
HEPTA 14:8d870350014c 14 pc.printf("Accel Sensor Mode\r\n");
HEPTA 14:8d870350014c 15 for(int i = 0; i<50; i++) {
HEPTA 14:8d870350014c 16 n_axis.sen_acc(&ax,&ay,&az);
HEPTA 14:8d870350014c 17 pc.printf("%f,%f,%f\r\n",ax,ay,az);
HEPTA 14:8d870350014c 18 wait(1.0);
HEPTA 14:8d870350014c 19 }
umeume 2:1c5cdb2c3e0f 20 }