Approved content
The content below is provided by a partner.
Makecode extensions for Ultimate SR04 RGB Ultrasonic Sensor, an I2C ultrasonic sensor with illuminate transceiver.
Additional inforamtion:
Initialize SR04 RGB
sgbotic.initialize(96)
Turn off all the LEDs
sgbotic.offAllLeds()
Set the color and light intensity of the RGB LED
sgbotic.colorLightIntensity(sgbotic.LedEnum.Red, 125)
Start distance measurement
sgbotic.trigger()
Read back the result in centimeter
sgbotic.readcm()
Read back the result in micro-second
sgbotic.readUs()
Read firmware version
sgbotic.readVersion()
Turn off all the LEDs
sgbotic.offAllLedMultiSr04(96)
Set the color and light intensity of the RGB LED
sgbotic.colorLightIntensityMultiSr04(sgbotic.LedEnum.Red, 125, 96)
Start distance measurement
sgbotic.triggerMultiSr04(96)
Read back the result in centimeter
sgbotic.readCmMultiSr04(96)
Read back the result in micro-second
sgbotic.readUsMultiSr04(96)
Read firmware version
sgbotic.readVersionMultiSr04(96)
sgbotic.changeAddr(96, 86)
MIT
SGBotic-Ultimate-SR04-RGB=github:SGBotic/pxt-SGBotic-Ultimate-SR04-RGB#v1.0