This is Compact Conoroller program using "FEP" library.

Dependencies:   FEP mbed

Files at this revision

API Documentation at this revision

Comitter:
eil4nyqn
Date:
Sat Jul 22 06:22:48 2017 +0000
Parent:
2:cb00e9fed324
Commit message:
updated FEP library, not checked operation

Changed in this revision

FEP.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r cb00e9fed324 -r 86eed23d1883 FEP.lib
--- a/FEP.lib	Fri Jul 14 13:25:03 2017 +0000
+++ b/FEP.lib	Sat Jul 22 06:22:48 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/NHK-Robocon2016_Nagaoka_B_Team/code/FEP/#67bcc5052829
+https://developer.mbed.org/teams/NHK-Robocon2016_Nagaoka_B_Team/code/FEP/#74e21751ac10
diff -r cb00e9fed324 -r 86eed23d1883 main.cpp
--- 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);
         }
     }
 }