BrianPeek / legoev3

LEGO MINDSTORMS EV3 API for .NET
Apache License 2.0
137 stars 72 forks source link

Battery level status #25

Closed sergeyzwezdin closed 4 years ago

sergeyzwezdin commented 7 years ago

Are there any way to read battery status of EV3 brick?

BrianPeek commented 7 years ago

Not with this library. I'm not sure if there's a command for that or not...

andiikaa commented 7 years ago

I have "ported" this library to swift and implemented the bat level.

The Opcodes are: UIRead_GetVBatt = 0x8101 UIRead_GetLBatt = 0x8112

In the "Firmware Developer Guide" (https://www.lego.com/de-de/mindstorms/downloads) is the description on page 90 (search for GET_VBATT).

LBatt should be the level (0-100). You will receive a UInt8 from the EV3, which represents the current battery level.

sergeyzwezdin commented 7 years ago

@andiikaa

I have "ported" this library to swift and implemented the bat level.

Is it possible to use your lib to build OS X app (not iOS)?

andiikaa commented 7 years ago

I dont know exactly but i think it wont work, because i am using the External​Accessory Framework which is iOS specific. But this lib here, should be easy to extend for the battery stuff.

Unfortunately i don´t own a Ev3 so i can not implement and test it.