Hi,
I've been using python to try to access the battery state on a metamotion c, but nothing seems to be working.
I am wondering if the function "get_battery_state_data_signal" only works for metamotion r?
Hi Eric,
I am not sure if it is an issue.
I am just wondering if I am doing something incorrect in my code (which is very likely).
When I try to add the function, I am not getting any errors, but I am not getting any print output either, so I'm just a bit confused regarding how to call that function.
Sorry, here is more information
I have attached a txt file of my code.
I try to print the battery voltage with print(BatteryState.voltage).
But the output is "Field type=c_ushort, ofs=0, size=2"
How do I obtain the actual value of the voltage?
Comments
https://mbientlab.com/community/discussion/3167/how-to-report-an-issue#latest
Hi Eric,
I am not sure if it is an issue.
I am just wondering if I am doing something incorrect in my code (which is very likely).
When I try to add the function, I am not getting any errors, but I am not getting any print output either, so I'm just a bit confused regarding how to call that function.
Thanks
I think Eric is asking you to share code and more details. There is so little information in your post I might have to delete this entire thread.
Sorry, here is more information
I have attached a txt file of my code.
I try to print the battery voltage with print(BatteryState.voltage).
But the output is "Field type=c_ushort, ofs=0, size=2"
How do I obtain the actual value of the voltage?
This is explained in the tutorials and documentation.
https://mbientlab.com/cppdocs/latest/mblmwdatasignal.html#readable-signals
https://mbientlab.com/cppdocs/latest/settings.html#battery-state
https://mbientlab.com/tutorials/WPython2.html#log-temperature-and-timer
Oh sorry about that, I didn't find the page on readable signals.
That makes a lot more sense.
Thanks Eric!