![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Uplink data Q
Dependencies: mbed PowerControl SDFileSystem
Fork of Hepta_UplinkData_Q by
main.cpp@1:d9b4d2303984, 2016-12-13 (annotated)
- Committer:
- tomoya123
- Date:
- Tue Dec 13 09:54:46 2016 +0000
- Revision:
- 1:d9b4d2303984
- Parent:
- 0:edad9f0f386a
Xbee 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'){ |
tomoya123 | 0:edad9f0f386a | 23 | xbee.printf("Command Get%d\r\n"); |
tomoya123 | 0:edad9f0f386a | 24 | for(int j=1;j<10;j++){ |
tomoya123 | 0:edad9f0f386a | 25 | |
tomoya123 | 0:edad9f0f386a | 26 | |
tomoya123 | 1:d9b4d2303984 | 27 | //加速度、電圧値をGround Stationに送信 |
tomoya123 | 0:edad9f0f386a | 28 | |
tomoya123 | 0:edad9f0f386a | 29 | } |
tomoya123 | 0:edad9f0f386a | 30 | } |
tomoya123 | 1:d9b4d2303984 | 31 | xbee.initialize(); |
tomoya123 | 0:edad9f0f386a | 32 | } |
tomoya123 | 1:d9b4d2303984 | 33 | wait (1.0); |
tomoya123 | 0:edad9f0f386a | 34 | } |
tomoya123 | 0:edad9f0f386a | 35 | } |