![](/media/cache/profiles/2e74f94b232c5a0cc3e75b4eaaf64c90.jpg.50x50_q85.jpg)
Hepta 9axis Sensor(Gyroscope)
Dependencies: mbed HeptaBattery Hepta9axis
Fork of Lab7-01_template by
main.cpp@16:c238ef7aa7e5, 2019-08-19 (annotated)
- Committer:
- HEPTA
- Date:
- Mon Aug 19 05:38:14 2019 +0000
- Revision:
- 16:c238ef7aa7e5
- Parent:
- 15:1d9772c3fe72
- Child:
- 17:e4a3f3d5ee58
Who changed what in which revision?
User | Revision | Line number | New 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 | 15:1d9772c3fe72 | 10 | EN = 1; // EN pin : high |
HEPTA | 14:ebe9ec72b3e2 | 11 | pc.baud(9600); |
HEPTA | 14:ebe9ec72b3e2 | 12 | float gx,gy,gz; |
HEPTA | 14:ebe9ec72b3e2 | 13 | pc.printf("Gyro Sensor Mode\r\n"); |
HEPTA | 14:ebe9ec72b3e2 | 14 | for(int i = 0; i<50; i++) { |
HEPTA | 14:ebe9ec72b3e2 | 15 | n_axis.sen_gyro(&gx,&gy,&gz); |
HEPTA | 14:ebe9ec72b3e2 | 16 | pc.printf("%f,%f,%f\r\n",gx,gy,gz); |
HEPTA | 14:ebe9ec72b3e2 | 17 | wait(1.0); |
HEPTA | 14:ebe9ec72b3e2 | 18 | } |
umeume | 2:1c5cdb2c3e0f | 19 | } |