diff --git a/shittyrobot.py b/shittyrobot.py index d1aff6a..3262b6f 100644 --- a/shittyrobot.py +++ b/shittyrobot.py @@ -64,17 +64,17 @@ c = [] def controlloop(last_start, next_action): now = time.ticks_us() - #print('CTRL: ', last_start, next_action) + print('CTRL: ', last_start, next_action) if time.ticks_diff(now, time.ticks_add(last_start, 100000)) < 0: - print(' DEADTIME -> ignore') - return last_start + print(' DEADTIME -> ignore') + return last_start if next_action is None and time.ticks_diff(time.ticks_add(last_start, 601000), now) > 0: - print(' ACTION TIMED OUT -> stopping') - next_action = (0,0) + print(' ACTION TIMED OUT -> stopping') + next_action = (0,0) elif next_action is None: - return last_start - + return last_start + print('Starting action: ', next_action) if next_action[0] == 1: @@ -146,9 +146,9 @@ def mainloop(l): elif a == b'w': next_action = (1, 1) elif a == b'a': - next_action = (0, 1) + next_action = (-1, 1) elif a == b'd': - next_action = (1, 0) + next_action = (1, -1) elif a == b's': next_action = (-1, -1) elif a in [b'\n', b'\r']: