Skip to content

adafruit_funhouse/peripherals.py bug in call funhouse.peripherals.any_button_pressed #36

Closed
@dd413

Description

@dd413

Fixed bug in adafruit_funhouse/peripherals.py, line 164, function :any_button_pressed" to correct error in call: funhouse.peripherals.any_button_pressed.

correction is
change:
return True in [button.value for button in enumerate(self._buttons)]
to:
return True in [button.value for (i, button) in enumerate(self._buttons)]

Here is the serial window’s REPL output;
CIRCUITPY/boot_out.txt
Adafruit CircuitPython 7.2.0-alpha.1 on 2021-12-29; Adafruit FunHouse with ESP32S2
Board ID:adafruit_funhouse

Press any key to enter the REPL. Use CTRL-D to reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
28.7035 21.8081
Traceback (most recent call last):
File "code.py", line 180, in
File "adafruit_funhouse/peripherals.py", line 164, in any_button_pressed
File "adafruit_funhouse/peripherals.py", line 164, in
AttributeError: 'tuple' object has no attribute 'value'

Code done running.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions