from microbit import *
while True:
water_ level =pinl. read_ analog () #将p1引脚的模拟值设为变量“water_ level”
if water_ level<300:
display. show (Image. SAD)
else:
display. show (Image. HAPPY)
微信扫码预览、分享更方便