![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Hepta UplinkData Q
Dependencies: mbed PowerControl SDFileSystem
Fork of Hepta_UplinkData_Q by
main.cpp@0:edad9f0f386a, 2016-12-09 (annotated)
- Committer:
- tomoya123
- Date:
- Fri Dec 09 05:16:28 2016 +0000
- Revision:
- 0:edad9f0f386a
- Child:
- 1:d9b4d2303984
Uplinkdata
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 | 0:edad9f0f386a | 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 | int dsize[2]; |
tomoya123 | 0:edad9f0f386a | 18 | for(int i=1;i<10;i++){ |
tomoya123 | 0:edad9f0f386a | 19 | xbee.printf("num = %d\r\n",i); |
tomoya123 | 0:edad9f0f386a | 20 | xbee.xbee_recieve(&rcmd,&cmdflag); |
tomoya123 | 0:edad9f0f386a | 21 | pc.printf("rcmd=%d,cmdflag=%d\r\n",rcmd,cmdflag); |
tomoya123 | 0:edad9f0f386a | 22 | if(cmdflag==1){ |
tomoya123 | 0:edad9f0f386a | 23 | if(rcmd=='a'){ |
tomoya123 | 0:edad9f0f386a | 24 | xbee.printf("Command Get%d\r\n"); |
tomoya123 | 0:edad9f0f386a | 25 | for(int j=1;j<10;j++){ |
tomoya123 | 0:edad9f0f386a | 26 | |
tomoya123 | 0:edad9f0f386a | 27 | |
tomoya123 | 0:edad9f0f386a | 28 | //加速度センサー、電圧値の取得 |
tomoya123 | 0:edad9f0f386a | 29 | |
tomoya123 | 0:edad9f0f386a | 30 | |
tomoya123 | 0:edad9f0f386a | 31 | } |
tomoya123 | 0:edad9f0f386a | 32 | xbee.printf("\rHEPTA Uplink OK\r"); |
tomoya123 | 0:edad9f0f386a | 33 | } |
tomoya123 | 0:edad9f0f386a | 34 | xbee.initialize(); |
tomoya123 | 0:edad9f0f386a | 35 | } |
tomoya123 | 0:edad9f0f386a | 36 | wait (1.0); |
tomoya123 | 0:edad9f0f386a | 37 | } |
tomoya123 | 0:edad9f0f386a | 38 | } |