![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Hepta UplinkData Q
Dependencies: mbed PowerControl SDFileSystem
Fork of Hepta_UplinkData_Q by
Diff: main.cpp
- Revision:
- 0:edad9f0f386a
- Child:
- 1:d9b4d2303984
diff -r 000000000000 -r edad9f0f386a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 09 05:16:28 2016 +0000 @@ -0,0 +1,38 @@ +#include "mbed.h" +#include "HeptaXbee.h" +#include "HeptaAccel.h" +#include "HeptaBattery.h" + +Serial pc(USBTX,USBRX); + +//ピンアサイン読み込み、オブジェクトの生成 + + +int main() { + pc.baud(9600); + xbee.baud(9600); + xbee.printf("Xbee Uplink Ok Mode\r\n"); + int rcmd=0,cmdflag=0; + //変数の定義 + int dsize[2]; + for(int i=1;i<10;i++){ + xbee.printf("num = %d\r\n",i); + xbee.xbee_recieve(&rcmd,&cmdflag); + pc.printf("rcmd=%d,cmdflag=%d\r\n",rcmd,cmdflag); + if(cmdflag==1){ + if(rcmd=='a'){ + xbee.printf("Command Get%d\r\n"); + for(int j=1;j<10;j++){ + + + //加速度センサー、電圧値の取得 + + + } + xbee.printf("\rHEPTA Uplink OK\r"); + } + xbee.initialize(); + } + wait (1.0); + } +} \ No newline at end of file