If you connect the sonar sensor to Arduino using another example code, you can check the data normally.
However, I have not checked it using the USB serial converter module.
If you connect the sonar sensor to Arduino using another example code, you can check the data normally.
However, I have not checked it using the USB serial converter module.
what example do you have that works?
I will make a new version, it shouldnβt take long.
the problem was it needed to have the data requested by sending 0X55, there might be a different version that sends data out automatically or can be set to.
I have uploaded it again, there is a mode selector at the start,
mode 1 will request data every 100ms
mode 2 will request data every time ardupilot requests data, so it should produce data only when connected to ardupilot.
I forgot to initialise softserial.
It seems the same.
Sonar data is read every few seconds??
The RX LED on the Uno board initially blinks once and does not blink after that.
I think the software serial might be interfering with i2c when running at 115200 I have commented out i2c on this to see if thats the issue. if it is then we just need to reverse the serial ports with the sonar on the hardware port.
I missed a few lines when commenting out i2c.
it should just operate like the example,try this, I think there was a mixup with distances and Distances.
the led should come on when it requests sonar data and go off when it gets a valid packet.
this is strange, ok this is just a straight copy and paste from your example, i cant see why this wont work.
can you try your example again just to verify that the sensor is still working
That last one I sent you was just your example, all my code was commented out so it should have worked.
yes i spaced it out so you could see where the parts of the code were, can you try your example again to verify that it still works.
all the other code is commented out it shouldnβt make any difference, thatβs why I think there is some kind of hardware issue.
I donβt understand either.
I only added information related to I2C connection.
Why the error occurs.