Right now I have an RC car program of arundiofor Arduino. The code is like this:
void loop()
{ {
distance = Dist.getDistanceCentimeter();
if(distance<=5 & distance>1)
if(Serial.available())
{
lkf = Serial.read();
switch(lkf)
{
case 'a':
forward();
servoX.write(90);
lkf=0;
break;
}
}
So I already writewrote a TCPcilentTCPclient that can order the RC car to move forward by connectconnecting through TCPTCP and sendsending the message "a" to the arundioArduino board.
The problem is how to return the distancedistance to the cilent? isIs it simply return distance; or something like system.println(distance); ? Thanks for helping.