Hi i dont know if im in the rigth topic but anyway, I got som old components from a lab and im trying to get data from a measuring device.
the device have a weird connector but Luckely they are labled
BAT, GND, syson, TXO, RXO
My guess is the following
BAT v soucs 3.3v
GND obvious
Syson to power on the device for measuring (same as one of the buttons)
TXO Serial com
RXO Serial com
the thing also had a battery connected(not thru the connector).
I usally only use ardoinos for servos and stuff so this is totally new for me.
so what i need help with is 1 figure out what to connect where and 2 how to read the data from the serial com.
I have tried to solder on som cables to the connector (sens its an weird connector) and use some code i found for a range finder (sens that is what i think it is) just to try to get some data.
This is the code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);
unsigned char data[8]={0};
void setup()
{
Serial.begin(9600);
mySerial.begin(115200);
}
void loop()
{
//mySerial.print(buff);
while(1)
{
if(mySerial.available()>0)
{
delay(50);
for(int i=0;i<7;i++)
{
data[i]=mySerial.read();
Serial.print(data[i]);
}
float distance=0;
distance=data[6]*256+data[7]*0.001 ;
Serial.print("Distance = ");
Serial.print(distance);
Serial.println(" M");
delay(20);
}
}
}
And this is what i got from the serial monitor : 0255255255255255255Distance = -256.00 M