Lab4
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS
main.cpp@26:443ad6fe9ea4, 2019-08-27 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Tue Aug 27 04:10:52 2019 +0000
- Revision:
- 26:443ad6fe9ea4
- Parent:
- 25:c5fa5fc8320b
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
HeptaSatTraining2019 | 26:443ad6fe9ea4 | 2 | #include "HEPTA_EPS.h" |
HeptaSatTraining2019 | 26:443ad6fe9ea4 | 3 | #include "HEPTA_SENSOR.h" |
HeptaSatTraining2019 | 24:3659e0c223c8 | 4 | |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 5 | Serial pc(USBTX, USBRX); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 6 | HEPTA_EPS eps(p16,p26); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 7 | HEPTA_SENSOR sensor(p17, |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 8 | p28,p27,0xD0,0x18, |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 9 | p13, p14,p25,p24); |
HeptaSatTraining2019 | 24:3659e0c223c8 | 10 | |
umeume | 2:1c5cdb2c3e0f | 11 | int main() |
umeume | 2:1c5cdb2c3e0f | 12 | { |
HeptaSatTraining2019 | 24:3659e0c223c8 | 13 | pc.baud(9600); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 14 | float ax,ay,az; |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 15 | pc.printf("Accel Sensor Mode\r\n"); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 16 | for(int i = 0; i<50; i++) { |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 17 | sensor.sen_acc(&ax,&ay,&az); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 18 | pc.printf("%f,%f,%f\r\n",ax,ay,az); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 19 | wait(1.0); |
HeptaSatTraining2019 | 24:3659e0c223c8 | 20 | } |
umeume | 2:1c5cdb2c3e0f | 21 | } |