diff --git a/assignments/03-game-controller-discover/code_solution.md b/assignments/03-game-controller-discover/code_solution.md index 9a89068..e79ca74 100644 --- a/assignments/03-game-controller-discover/code_solution.md +++ b/assignments/03-game-controller-discover/code_solution.md @@ -15,13 +15,14 @@ while True: if current_state is state_wait: keyboard.press(key) # Send our defined key as a command... print("button is pressed") #Print a confirmation in the serial monitor - keyboard.release_all() # and release all keys again current_state = state_button_is_pressed # Update our state elif button.value is False: if current_state is state_button_is_pressed: + keyboard.release_all() # and release all keys again print("button is released") # Print a confirmation in the serial monitor + current_state = state_wait # Reset the state # Sleep briefly so keypress events occur at a human timescale.