Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angle_sensor = unit.get(unit.ANGLE, unit.PORTB)
- label0 = M5TextBox(96, 113, "label0", lcd.FONT_Default, 0xFFFFFF, rotate =0)
- # первый вариант
- while True:
- angle = angle_sensor.read()
- if 0 <= angle < 256:
- label0.setText("1")
- elif 256 <= angle < 512:
- label0.setText("2")
- else:
- label0.setText("3")
- # второй вариант
- while True:
- angle = angle_sensor.read()
- if 0 <= angle < 256:
- label0.setText("1")
- elif 256 <= angle < 512:
- label0.setText("2")
- elif 512 <= angle < 1024:
- label0.setText("3")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement