Lab5
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS HEPTA_COM
main.cpp
- Committer:
- HeptaSatTraining2019
- Date:
- 2019-11-04
- Revision:
- 29:e17b0c6d4c16
- Parent:
- 26:1a95952b6fd1
File content as of revision 29:e17b0c6d4c16:
#include "mbed.h" #include "HEPTA_EPS.h" #include "HEPTA_SENSOR.h" #include "HEPTA_COM.h" Serial pc(USBTX,USBRX); int main() { int i = 0,rcmd=0,cmdflag=0; com.printf("Count Up!\r\n"); while(1) { com.printf("num = %d\r\n",i); i++; wait(1.0); com.xbee_receive(&rcmd,&cmdflag); pc.printf("rcmd=%d, cmdflag=%d\r\n",rcmd, cmdflag); if (cmdflag == 1) { if (rcmd == 'a') { pc.printf("Command Get %d\r\n",rcmd); com.printf("HEPTA Uplink OK\r\n"); pc.printf("===================\r\n"); pc.printf("Accel sensing Mode\r\n"); pc.printf("===================\r\n"); for(int ii = 0; ii < 10; ii++) { sensor.sen_acc(&ax,&ay,&az); eps.vol(&bt); wait(0.5); } } com.initialize(); } } }