-
|
Hi! Now I want to test a simple ON/OFF switch so I created a crippled Tilt Sensor, with just one mode (0) that reads just one int8. I named it 'MYOWNSWITCH' and used the same ID as the Tilt Sensor. PUPDevice recognizes it fine: and I can read the state of a GPIO pin on the ESP32 and send '0' when it is LOW and '100' when it is HIGH, good enough, can map those values to ON/OFF or anything else in my Pybricks script: But If I change the ID for an unknown device (like '99') then PUPDevice cannot recognize it (OSError: [Errno 19] ENODEV). I am just changing the CMD_TYPE message like this: Is there a way to assign custom ID's? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Does it work if you use an unassigned number between two known numbers, like 36? The enum we are currently using doesn't reserve any space for higher numbers, so picking a random number like 99 could actually coincide with something else. |
Beta Was this translation helpful? Give feedback.
Does it work if you use an unassigned number between two known numbers, like 36?
The enum we are currently using doesn't reserve any space for higher numbers, so picking a random number like 99 could actually coincide with something else.