Hepta UplinkData Q
Dependencies: mbed PowerControl SDFileSystem
Fork of Hepta_UplinkData_Q by
main.cpp@4:2a2a17a603cc, 2016-12-23 (annotated)
- Committer:
- MEXT1
- Date:
- Fri Dec 23 04:50:09 2016 +0000
- Revision:
- 4:2a2a17a603cc
- Parent:
- 3:bbd4ea2952cb
UplinkData Q
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tomoya123 | 0:edad9f0f386a | 1 | #include "mbed.h" |
tomoya123 | 0:edad9f0f386a | 2 | #include "HeptaXbee.h" |
tomoya123 | 0:edad9f0f386a | 3 | #include "HeptaAccel.h" |
tomoya123 | 0:edad9f0f386a | 4 | #include "HeptaBattery.h" |
tomoya123 | 0:edad9f0f386a | 5 | |
tomoya123 | 0:edad9f0f386a | 6 | Serial pc(USBTX,USBRX); |
tomoya123 | 1:d9b4d2303984 | 7 | //ピンアサイン読み込み、オブジェクトの生成 |
tomoya123 | 0:edad9f0f386a | 8 | |
tomoya123 | 0:edad9f0f386a | 9 | |
tomoya123 | 0:edad9f0f386a | 10 | |
tomoya123 | 0:edad9f0f386a | 11 | int main() { |
tomoya123 | 0:edad9f0f386a | 12 | pc.baud(9600); |
tomoya123 | 0:edad9f0f386a | 13 | xbee.baud(9600); |
tomoya123 | 0:edad9f0f386a | 14 | xbee.printf("Xbee Uplink Ok Mode\r\n"); |
tomoya123 | 0:edad9f0f386a | 15 | int rcmd=0,cmdflag=0; |
tomoya123 | 0:edad9f0f386a | 16 | //変数の定義 |
tomoya123 | 0:edad9f0f386a | 17 | for(int i=1;i<10;i++){ |
tomoya123 | 0:edad9f0f386a | 18 | xbee.printf("num = %d\r\n",i); |
tomoya123 | 0:edad9f0f386a | 19 | xbee.xbee_recieve(&rcmd,&cmdflag); |
tomoya123 | 0:edad9f0f386a | 20 | pc.printf("rcmd=%d,cmdflag=%d\r\n",rcmd,cmdflag); |
tomoya123 | 0:edad9f0f386a | 21 | if(cmdflag==1){ |
tomoya123 | 0:edad9f0f386a | 22 | if(rcmd=='a'){ |
MEXT1 | 4:2a2a17a603cc | 23 | pc.printf("Command Get\r\n"); |
MEXT1 | 3:bbd4ea2952cb | 24 | xbee.printf("HEPTA Uplink OK\r\n"); |
tomoya123 | 0:edad9f0f386a | 25 | for(int j=1;j<10;j++){ |
tomoya123 | 0:edad9f0f386a | 26 | |
tomoya123 | 0:edad9f0f386a | 27 | |
tomoya123 | 1:d9b4d2303984 | 28 | //加速度、電圧値をGround Stationに送信 |
tomoya123 | 0:edad9f0f386a | 29 | |
tomoya123 | 0:edad9f0f386a | 30 | } |
tomoya123 | 0:edad9f0f386a | 31 | } |
tomoya123 | 1:d9b4d2303984 | 32 | xbee.initialize(); |
tomoya123 | 0:edad9f0f386a | 33 | } |
tomoya123 | 1:d9b4d2303984 | 34 | wait (1.0); |
tomoya123 | 0:edad9f0f386a | 35 | } |
tomoya123 | 0:edad9f0f386a | 36 | } |