![](/media/cache/profiles/2e74f94b232c5a0cc3e75b4eaaf64c90.jpg.50x50_q85.jpg)
Hepta 9axis Sensor(Magnetometer)
Dependencies: mbed HeptaBattery Hepta9axis
Fork of Lab7-01_template by
main.cpp@18:748c13c8a567, 2019-08-19 (annotated)
- Committer:
- HEPTA
- Date:
- Mon Aug 19 06:48:26 2019 +0000
- Revision:
- 18:748c13c8a567
- Parent:
- 16:9dc19bd7b8ff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
umeume | 2:1c5cdb2c3e0f | 2 | #include "Hepta9axis.h" |
HEPTA | 16:9dc19bd7b8ff | 3 | #include "HeptaBattery.h" |
umeume | 2:1c5cdb2c3e0f | 4 | |
umeume | 2:1c5cdb2c3e0f | 5 | Serial pc(USBTX,USBRX); |
HEPTA | 10:4d6870d0caa0 | 6 | Hepta9axis n_axis(p28,p27,0xD0,0x18); |
HEPTA | 18:748c13c8a567 | 7 | HeptaBattery battery(p16,p26); |
umeume | 2:1c5cdb2c3e0f | 8 | int main() |
umeume | 2:1c5cdb2c3e0f | 9 | { |
HEPTA | 14:ebfbfbea3d7c | 10 | pc.baud(9600); |
HEPTA | 14:ebfbfbea3d7c | 11 | float mx,my,mz; |
HEPTA | 14:ebfbfbea3d7c | 12 | pc.printf("Magnetometer Mode\r\n"); |
HEPTA | 14:ebfbfbea3d7c | 13 | for(int i = 0; i<50; i++) { |
HEPTA | 14:ebfbfbea3d7c | 14 | n_axis.sen_mag(&mx,&my,&mz); |
HEPTA | 14:ebfbfbea3d7c | 15 | pc.printf("%f,%f,%f\r\n",mx,my,mz); |
HEPTA | 14:ebfbfbea3d7c | 16 | wait(1.0); |
HEPTA | 14:ebfbfbea3d7c | 17 | } |
umeume | 2:1c5cdb2c3e0f | 18 | } |