Lab4
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS
main.cpp@30:9dd4ebe330f1, 2019-11-04 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Mon Nov 04 16:11:03 2019 +0000
- Revision:
- 30:9dd4ebe330f1
- Parent:
- 27:980fc888f1de
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
HeptaSatTraining2019 | 27:980fc888f1de | 2 | #include "HEPTA_EPS.h" |
HeptaSatTraining2019 | 27:980fc888f1de | 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 | 26:c27c56c3fe93 | 14 | float gx,gy,gz; |
HeptaSatTraining2019 | 26:c27c56c3fe93 | 15 | pc.printf("Gyro Sensor Mode\r\n"); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 16 | for(int i = 0; i<50; i++) { |
HeptaSatTraining2019 | 26:c27c56c3fe93 | 17 | sensor.sen_gyro(&gx,&gy,&gz); |
HeptaSatTraining2019 | 26:c27c56c3fe93 | 18 | pc.printf("%f,%f,%f\r\n",gx,gy,gz); |
HeptaSatTraining2019 | 25:c5fa5fc8320b | 19 | wait(1.0); |
HeptaSatTraining2019 | 24:3659e0c223c8 | 20 | } |
umeume | 2:1c5cdb2c3e0f | 21 | } |