Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
fixed integration bugs on backend
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamah committed Feb 10, 2020
1 parent 1266d12 commit d8082fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/process_user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ def run(self):
event, cpx._Express__state[event]
)
elif device == MICROBIT:
new_state = new_state.get("state", {})
for button in CONSTANTS.EXPECTED_INPUT_EVENTS_BUTTONS_MICROBIT:
previous_pressed = None
exec(f"previous_pressed = mb.{button}.get_presses()")
button_pressed = new_state.get(event, previous_pressed)

if button_pressed != previous_pressed:
print(f"{event} is at {button_pressed}")
print(f"{button} is at {button_pressed}")
if button_pressed:
exec(f"mb.{button}._Button__press_down()")
else:
Expand Down

0 comments on commit d8082fa

Please sign in to comment.