Lab4
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS
main.cpp@29:e6a381cf8ea6, 2019-11-04 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Mon Nov 04 16:14:11 2019 +0000
- Revision:
- 29:e6a381cf8ea6
- Parent:
- 25:206c3d339595
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
HeptaSatTraining2019 | 25:206c3d339595 | 2 | #include "HEPTA_EPS.h" |
HeptaSatTraining2019 | 25:206c3d339595 | 3 | #include "HEPTA_SENSOR.h" |
umeume | 2:1c5cdb2c3e0f | 4 | |
umeume | 2:1c5cdb2c3e0f | 5 | Serial pc(USBTX,USBRX); |
HeptaSatTraining2019 | 21:92c25e853b87 | 6 | HEPTA_EPS eps(p16,p26); |
HeptaSatTraining2019 | 25:206c3d339595 | 7 | HEPTA_SENSOR sensor(p17, |
HeptaSatTraining2019 | 21:92c25e853b87 | 8 | p28,p27,0xD0,0x18, |
HeptaSatTraining2019 | 21:92c25e853b87 | 9 | p13, p14,p25,p24); |
umeume | 5:c5ccb1b07e8f | 10 | |
umeume | 2:1c5cdb2c3e0f | 11 | int main() |
umeume | 2:1c5cdb2c3e0f | 12 | { |
HeptaSatTraining2019 | 25:206c3d339595 | 13 | pc.baud(9600); |
HeptaSatTraining2019 | 25:206c3d339595 | 14 | float mx,my,mz; |
HeptaSatTraining2019 | 25:206c3d339595 | 15 | pc.printf("Magnetometer Mode\r\n"); |
HeptaSatTraining2019 | 25:206c3d339595 | 16 | for(int i = 0; i<50; i++) { |
HeptaSatTraining2019 | 25:206c3d339595 | 17 | sensor.sen_mag(&mx,&my,&mz); |
HeptaSatTraining2019 | 25:206c3d339595 | 18 | pc.printf("%f,%f,%f\r\n",mx,my,mz); |
HeptaSatTraining2019 | 25:206c3d339595 | 19 | wait(1.0); |
HeptaSatTraining2019 | 25:206c3d339595 | 20 | } |
umeume | 2:1c5cdb2c3e0f | 21 | } |