I'm trying to write some code to use the AXON2 and the SRF02-SRF08 ultrasonic rangers ( they both have the same i2C address and commands).

I have writen some code for the Wiring microcontroller ( the father of Arduino - they use the same "language") and it works great.

I used the same algorithms and steps in AXON2 using the Webbotlib, but I have a couple of issues:

1. The command to start a reading is not actually working, although it seems that code-wise it's accepted. I don't know what seems to be the problem, but in some point I need to stop the I2C transmission and start it again so I can read the registers that hold the actuall reading. I'm not very familiar with the inner works of Webbotlib since i'm new to AXON, but I think there must be a "start"-"stop" commands for I2C interface.

2. The reading results come in two bytes ( high-low) , I overpassed this by using unsigned char types, since there's no "byte" type, but there's nothing to read there since the I2C reading command is not working.

A couple of months ago, I interfaced the TPA81 and submitted the code here, and everything works fine with this sensor.

Once you got it working then I'd recommend removing the 'delay' and instead test if response[0] == 255 which indicates the ranging is still happening. Once you get a valid value back then store it in a global variable and start a new ranging. Therefore the device will constantly be ranging and you will have stored the last 'received' value into the global variable.