python get_motor_current always 0.0

This code: for i in range(8): current = mymarty.get_motor_current(i) print("motor", i, current)

It always seems to return 0.0 for all motors: ('motor', 0, 0.0)

I'm getting a sensible value for get_battery_voltage()

I'm using python 2.7.9, Rick firmware version 1.0 (using get_firmware_version).

Can anyone confirm if they have this working?



Leave a comment and join the discussion here

Please Log In or Sign Up to write a comment response

2 Responses


This sounds like the same problem discussed in Socket API problem with broken float32 return values over socket transport.

I just checked values in Scratch and they look plausible and mostly non 0.0 - I was puzzling over your range(8) and Scratch doesn't have a dropdown value to get the ninth one, the eye servo current.

20:34:05, 11th January 2018  *   |   Permalink   |   View Source

I get 0.0 for all. I also executed that during its periodic "i am powered on wiggle" and that came back with 0.0 from all range(9) too with v1.0.0 firmware and 3.4.5. And all 0.0 during a lengthy walk().

I too have just over 8v from get_battery_voltage and sensible results from get_accelerometer and digitalread_gpio(0) works using the supplied microswitch so the rest looks ok.

There is a scratch example which shows current and I've had that working so suggests something is amiss in python code.

I'm currently puzzling over how to do an analogue input read though!

19:31:33, 11th January 2018  *   |   Permalink   |   View Source