1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00

Cosmetics

This commit is contained in:
Andrey Pohilko 2017-09-22 19:35:16 +03:00
parent 227460d44d
commit bd85c2bdd2
2 changed files with 3 additions and 3 deletions

View File

@ -42,13 +42,13 @@ MSG_SENSOR_DATA = 0x45
MSG_SENSOR_SUBSCRIBE_ACK = 0x47
# DEVICE TYPES
DEV_AMPERAGE = 0x15 # one of them is button? onboard temperature? maybe another kind of voltage, they have same params
DEV_VOLTAGE = 0x14
DEV_AMPERAGE = 0x15
DEV_LED = 0x17
DEV_DCS = 0x25
DEV_IMOTOR = 0x26
DEV_MOTOR = 0x27
DEV_TILT_SENSOR = 0x28
DEV_LED = 0x17
DEVICE_TYPES = {
DEV_DCS: "DISTANCE_COLOR_SENSOR",

View File

@ -170,7 +170,7 @@ class EncodedMotor(Peripheral):
log.warning("Speed cannot be more than 1")
relative = 1
absolute = round(relative * 100)
absolute = round(relative * 100) # scale of 100 is proven by experiments
if absolute < 0:
absolute += 255
return int(absolute)