Devantech SRF02 sonar.
The sonar uses the I2C bus and also requires a +5v regulated supply. On the Axon this means using the power headers from an ADC pin. The sonar can measure distances from about 17cm to about 250 cm. The default I2C address is 0xE0 but can be changed to one of 16 values.
It may be defined using:
Devantech_SRF02 sensor = MAKE_Devantech_SRF02();
The sensor should be initialised in appInitHardware using:-
The sensor can then be read using:-
and then the distance in cm will be in sensor.distance.cm