NagaokaRoboticsClub_mbedTeam
/
CompactController_2017
This is Compact Conoroller program using "FEP" library.
Diff: main.cpp
- Revision:
- 3:86eed23d1883
- Parent:
- 2:cb00e9fed324
--- a/main.cpp Fri Jul 14 13:25:03 2017 +0000 +++ b/main.cpp Sat Jul 22 06:22:48 2017 +0000 @@ -4,7 +4,8 @@ BusIn onSW(PA_4,PA_5,PB_5,PB_4,PB_3,PA_15,PA_12); BusIn otherSW(PC_13,PC_14,PB_9,PC_15,PA_11,PA_1); AnalogIn Stick[4]={PA_6,PA_7,PB_0,PB_1}; -FEP fep(PA_2,PA_3); +FEP fep(PA_2,PA_3,000); +//FEP fep(PB_10,PB_11,000); Serial xbee(PA_9,PA_10,38400); Serial pc(PB_10,PB_11,115200); DigitalOut leds[4]={PB_15,PB_14,PB_13,PB_12}; @@ -42,13 +43,11 @@ double stick_val[4]; uint8_t SW_val[2]; char TXdata[128]; - //set reciever module address (the last three numbers of S/N) - const uint8_t address=198; uint8_t FEPstate; while(1) { getInputState(stick_val,SW_val); convertTXdata(stick_val,SW_val,TXdata); - FEPstate=fep.write_txt(TXdata,address,6); + FEPstate=fep.puts(TXdata,6); leds[3]!=leds[3]; if(FEPstate==FEP_P0){ leds[0]=0; @@ -69,7 +68,6 @@ leds[0]=1; leds[1]=1; leds[2]=1; - wait(0.1); } } }