r/pybricks

▲ 2 r/pybricks+1 crossposts

I'm wondering if anyone knows of any coding to check the battery voltage?

Right now, I have a code that tells me the battery life in percentage, but I can't seem to get an accurate reading between my two bots. (I.e. After 20 hours of charging, one hub will read 99% and the other will read 92% when plugged in, but immediately after unplugging the 99% will read 94% and the 92% will read at 87%.)

I figure that voltage would be more accurate.

reddit.com
u/snoopjannyjan — 9 days ago
▲ 5 r/pybricks+1 crossposts

LEGO SPIKE distance sensor behaves inconsistently — detects object sometimes but not always

I am working with the LEGO SPIKE ultrasonic distance sensor and I am running into an issue. The sensor behaves inconsistently depending on the lighting conditions — sometimes it detects an object at a certain distance, and sometimes it completely misses it, even though the object and the distance stay the same. More over sometimes one sensor detects the object while the other misses it. On the next attempt, the first sensor detects the object while the other misses it.

I have read through the technical specifications from LEGO, but I still do not fully understand what the sensor is actually measuring and why lighting would affect it. As far as I know, ultrasonic sensors should not be affected by light at all.

Has anyone experienced this before? What could cause this behaviour, and how can I make the detection more reliable?

reddit.com
u/Traditional_Being536 — 3 days ago