I need to read bytes from a measurement device, I have already visited several topics and I was able to implement some classes and read data through the serial port using the Javacomm and RXTXcomm API, but I am having difficulty interpreting the bits, I believe it is due to the way of reading .
The device emits a block of 8 bytes every second, the data is binary, reading as below I get to numbers equal or less than 255, what should I do to have readable data?
int Octeto1 = 0;
int LedRX = 13;
void setup () {
Serial1.begin(110); //Comunica com o medidor
Serial.begin(115200); //Comunica com o monitor serial PC
{
pinMode(LedRX, OUTPUT);
}
}
void loop () {
if (Serial1.available() > 0){
Serial.println("Recebendo Informacoes");
digitalWrite(LedRX, HIGH);
delay(100);
}
else {
digitalWrite(LedRX, LOW);
}
Octeto1 = Serial1.read();
Serial.println(Octeto1);
}