Lab4
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS
main.cpp@26:c27c56c3fe93, 2019-08-21 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Wed Aug 21 20:59:29 2019 +0000
- Revision:
- 26:c27c56c3fe93
- Parent:
- 25:c5fa5fc8320b
- Child:
- 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 | 21:92c25e853b87 | 2 | #include"HEPTA_EPS.h" |
HeptaSatTraining2019 | 21:92c25e853b87 | 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 | } |