Actually, i am new user Micro Controller ARDUINO. I have NJR Distance Sensor with build code but need to read different distance value which can create when obstacle at the front of my Sensor. So, for get output distances value me connect this sensor to ARDUINO UNO with the help of RX and TX communication UART based. But the output value are not correct sensor give me 5 different distance value i need just distance_1 value. The Sensor send 36bytes data how i read this data anyone guide me. Thanks
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
delay (2000);
}
}