send array of integers via xBee s1

the code of the car is ctrl_robot_....1_7_2, the one of the ground station is ctrl_xbee_...
short explanation for the car code:
float ping(): read the distance from the objects (used in automatic mode only)
void resetdirezione(angolatura): set and move the wheels to the specified angle
void direzione():decides which is the best direction (R or L)
--> int leggiseriale(): this is where the problem should be: this function has to read the data coming from the xbee and separate them in one array so that i can use the numbers easily
//void cercacasa(): unused at the moment (should seek IR and find home)
void destra() and void sinistra(): turn the wheels right or left (instead of them now i use resetdirezione(angle))
setup():...
void loop():read the data from the xbee and set the mode: if spia==0 the car moves on automatic mode (with HC-SR04 sensor), else it should use the numbers it gets from xbee to move)
short explanation for the ground station code:
i read the values from a playstation controller (just from 2 potentiometers and one button), than i send them: sz=car mode, sx=FW/BW,sy=R/L,200= default speed (for automatic mode)
if u need more explanation i will give you every info you need :slight_smile:
ps.the code, since leggiseriale()gives me back always 0, so automatic mode, works perfectly, the problme is that i want to use also the other mode
thank you
propilot

ctrl_robot_HC_SR04_test_serialmov_v1_7_2.ino (9.75 KB)