Fix example for gamepad

The example code for the gamepad module would skip detected
button presses in the code that waits for a button to be released,
because it would run it even when no button is pressed.

Also updated the example pin names to not use RX and TX.
This commit is contained in:
Radomir Dopieralski 2018-01-10 22:50:10 +01:00
parent d9ae709045
commit 0ff128ec03
1 changed files with 4 additions and 3 deletions

View File

@ -49,8 +49,8 @@ gamepad_obj_t* gamepad_singleton = NULL;
//|
//|
//| pad = gamepad.GamePad(
//| digitalio.DigitalInOut(board.D0),
//| digitalio.DigitalInOut(board.D1),
//| digitalio.DigitalInOut(board.D10),
//| digitalio.DigitalInOut(board.D11),
//| )
//|
//| y = 0
@ -63,8 +63,9 @@ gamepad_obj_t* gamepad_singleton = NULL;
//| y += 1
//| print(y)
//| time.sleep(0.1)
//| while pad.get_pressed():
//| while buttons:
//| # Wait for all buttons to be released.
//| buttons = pad.get_pressed()
//| time.sleep(0.1)
//|