Shop OBEX P1 Docs P2 Docs Learn Events
Reading a range using water sensor Question — Parallax Forums

Reading a range using water sensor Question

I have a WaveShare Liquid Water sensor that reads the amount of voltage it generates when dipped in water. It is plugged into pin1 of the analog of the micro:bit board. I have a range of values as an if statement using cyberbot python.

water = pin1.read_analog()

if water <= 400:
bot(0).write_digital(1)

This doesn't work however as when it reads under the range it doesn't perform the commands that follow. I was wondering if I was doing the statement wrong or what because I cannot find the error.

Comments

Sign In or Register to comment.