Update LEGO Technic 42176 XBOX RC.py
This commit is contained in:
parent
ec7caad836
commit
f5bc9ad12a
@ -44,6 +44,7 @@ class TechnicMoveHub:
|
||||
self.LIGHTS_OFF_OFF = 0b100
|
||||
self.LIGHTS_OFF_ON = 0b00000001
|
||||
self.LIGHTS_ON_ON = 0b000
|
||||
self.ID_LED = 0x11
|
||||
|
||||
def run_discover(self):
|
||||
try:
|
||||
@ -197,6 +198,8 @@ async def main():
|
||||
start_time = time.time()
|
||||
slow_mode = False
|
||||
slow_mode_old = False
|
||||
change_lights_because_of_slowmode_on = False
|
||||
change_lights_because_of_slowmode_off = False
|
||||
|
||||
try:
|
||||
while True:
|
||||
@ -230,9 +233,12 @@ async def main():
|
||||
if slow_mode == True:
|
||||
print("slowmode off")
|
||||
slow_mode = False
|
||||
#await hub.change_led_color(hub.LIGHTS_OFF_OFF)
|
||||
else:
|
||||
print("slowmode on")
|
||||
slow_mode = True
|
||||
#await hub.change_led_color(hub.LIGHTS_OFF_ON)
|
||||
slow_mode_old = slow_mode_cont
|
||||
|
||||
|
||||
if brake and not was_brake:
|
||||
@ -258,7 +264,6 @@ async def main():
|
||||
throttle_old = throttle
|
||||
steering_old = steering
|
||||
lights_old = lights
|
||||
slow_mode_old = slow_mode
|
||||
|
||||
# Flush the output
|
||||
sys.stdout.flush()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user