Closed cpseager closed 7 years ago
Also, in case anyone can make some use of this: supplyVoltage = (rawdata[1] * 49) / 1000;
Wow, thanks!
We have similar problem with sensors. We add 40 for tilt and 180 for distance.
https://github.com/AlanJAS/WeDoMore/blob/master/wedo/__init__.py
This change can broke some identifications?
I think the way Lego designed these values was to allow a a large tolerance, so for instance a tilt sensor could actually be any value between the boundaries e.g.
if (id < WEDO_TYPE_SHORTLO)
\\ is a short
else if (id < WEDO_TYPE_BEND)
\\ bend sensor
else if (id < WEDO_TYPE_TILT)
\\ tilt sensor
etc.
So for a tilt sensor values of 38,39, 40 are all well within this range (27 to 46)
If anyone has enough hardware to test these numbers and is interested in working on a PR expanding support, let me know!
Hopefully this info is useful:
https://github.com/itdaniher/WeDoMore/blob/master/wedo/__init__.py#L22
Add 240 as a valid motor ID value, as the stationary motor can also give out this ID value and so the motor identification can presently be a little unreliable at times.
Additionally if you also add in these values as valid motor values 99, 100, 101, 102 (servo, 88004) 203, 204 (lights, 8870)
these 2 power functions output devices will also start working (they are controlled as if they are motors so there is nothing else to do apart from make their ID a value valid)
For interest here is the complete set with the upper boundary value (and value of the internal pull-down resistor used to generate the iD). Note that many of these parts were never released by Lego!