Sugar Water Level Sensor Module
This is a water level sensor module, the pin holes on the back allow compatibility with plastic building bricks.
Product Specifications
- Dimensions: 24 x 24 x 23 mm
- Weight: 6.7g
- Type: Analog
Wiring
Use a 3Pin cable to connect the module to Robotbit Edu.
Programming Tutorial
MakeCode Programming Tutorial
Import Sugar Extension
Search for sugar in the search bar (Kittenbot products has been verified by Microsoft)
Extension URL
Sugar extension: https://github.com/KittenBot/pxt-sugar
Kittenblock Programming Tutorial
MicroPython Programming Tutorial
WaterLevel(pin)
value()
- value(): Returns sensor value
Sample Program
from future import *
from sugar import *
waterlevel_P0 = WaterLevel('P0')
x = 0
screen.sync = 0
while True:
screen.fill((0, 0, 0))
screen.text(waterlevel_P0.value(),5,10,2,(0, 119, 255))
screen.refresh()