Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
no_rumble = time.time() + 1
move_last_value = None
move = common.get_move(move_serial, move_num)
team_colors = common.generate_colors(team_num)
#keep on looping while move is not dead
ready = False
move.set_leds(0,0,0)
move.update_leds()
time.sleep(1)
death_time = 8
time_of_death = time.time()
move_opts[Opts.holding.value] = Holding.not_holding.value
move_opts[Opts.selection.value] = Selections.nothing.value
while True:
if sum(force_color) != 0:
no_rumble_time = time.time() + 5
time.sleep(0.01)
move.set_leds(*force_color)
move.update_leds()
move.set_rumble(0)
no_rumble = time.time() + 0.5
#if we are not dead
elif dead_move.value == 1:
if move.poll():
ax, ay, az = move.get_accelerometer_frame(psmove.Frame_SecondHalf)
total = sum([ax, ay, az])
if move_last_value is not None:
change = abs(move_last_value - total)