Switching mode of PUPDevice only works with read, not with write method #1213
Labels
bug
Something isn't working
platform: Powered Up
Issues related to LEGO Powered Up
software: pybricks-micropython
Issues with Pybricks MicroPython firmware (or EV3 runtime)
topic: sensors
Issues involving sensors
Describing the bug
The bug only appears to be present in the beta pybricks firmware (Pybricks MicroPython v1.20.0-23-g6c633a8dd on 2023-07-07; SPIKE Prime Hub with STM32F413VG).
When writing to a PUPDevice, the
write(mode,data)
method is used, with themode
the mode of the sensor to write data to. E.g. the Distance sensor uses mode 5 to set the values of LEDS around the two sensors with 4 segments representing the 4 bytes of the data. When I read another mode first, and write immediately to mode 5, I get an error.Using the latest pybricks firmware (Pybricks MicroPython v3.2.3 on 2023-02-17; SPIKE Prime Hub with STM32F413VG) this works OK, and the program below does not result in an error.
To reproduce
Steps to reproduce the behavior:
Expected behavior
The program should run without errors.
Screenshots
The text was updated successfully, but these errors were encountered: