10
0

add timestamp & round battery voltage

This commit is contained in:
Silver Kuusik 2019-04-14 16:25:28 +02:00
parent 80c3324703
commit 6892e0d3bc
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,8 @@
"status_led_pin": 22,
"battery_coeff": 2.25,
"sumo_id": "xxxxxxxx",
"firmware_version": "0.4.0",
"firmware_timestamp": "2019.04.07 14:44:00",
"firmware_version": "0.4.1",
"left_servo_tuning": 33,
"right_servo_tuning": 33,
"ultrasonic_distance": 40,

2
hal.py
View File

@ -128,7 +128,7 @@ class Sumorobot(object):
sleep_us(10)
self.trigger.value(0)
# Wait for the pulse and calculate the distance
return (time_pulse_us(self.echo, 1, 30000) / 2) / 29.1
return round((time_pulse_us(self.echo, 1, 30000) / 2) / 29.1, 2)
# Function to get boolean if there is something in front of the SumoRobot
def is_opponent(self):