We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c17c9a3 commit 69f4469Copy full SHA for 69f4469
arduino_alvik.py
@@ -609,6 +609,13 @@ def _parse_message(self) -> int:
609
610
return 0
611
612
+ def get_battery_charge(self) -> float:
613
+ """
614
+ Returns the battery SOC
615
+ :return:
616
617
+ return self.battery_perc
618
+
619
def _get_touch(self) -> int:
620
"""
621
Returns the touch sensor's state
examples/message_reader.py
@@ -18,6 +18,7 @@
18
print(f'TOUCH: {alvik.touch_bits}')
19
print(f'RGB: {alvik.red} {alvik.green} {alvik.blue}')
20
print(f'LINE: {alvik.left_line} {alvik.center_line} {alvik.right_line}')
21
+ print(f'SOC: {alvik.get_battery_charge()}%')
22
23
alvik.set_wheels_speed(speed, speed)
24
speed = (speed + 1) % 60
0 commit comments