Python examples for Ultimate SR04 RGB Ultrasonic Sensor, an I2C ultrasonic sensor with illuminate transceiver.
These examples to be run on Python3.
-
go to Menu >> Preferences >> Raspberry Pi Configuration to enable I2C interface
-
Install “python-smbus” and “i2c-tools”
sudo apt-get update
sudo apt-get install -y python-smbus i2c-tools
- Scan the connected I2C devices
i2cdetect -y 1