[2J[1;1H[38;5;11m
GPIO demo
===========
[39m
This demo showcases how to poll a hardware button attached to a GPIO
pin and how to flash an LED attached to another one.
[38;5;2mTo get started, follow these steps:
[39m
1. Connect an LED to pin 18 and to ground; don't forget to add a
resistor inline.
2. Connect a push button to pin 8 and to ground. We'll be
using the built-in pull-up resistor for the input pin so there is
no need to do any extra wiring.
[38;5;1mThis demo is only functional on the Raspberry Pi and assumes you have
built EndBASIC with --features=rpi. If these conditions are not met,
the demo will fail to run.
[39m
[2J[1;1H[38;5;11m
GPIO demo
===========
[39m
Waiting for a button press on pin 8 ...
Button pressed! Blinking LED on pin 18 ...
5
4
3
2
1
Dumping GPIO trace...
__GPIO_MOCK_DATA 0 -1
__GPIO_MOCK_DATA 1 803
__GPIO_MOCK_DATA 2 1804
__GPIO_MOCK_DATA 3 811
__GPIO_MOCK_DATA 4 811
__GPIO_MOCK_DATA 5 810
__GPIO_MOCK_DATA 6 1821
__GPIO_MOCK_DATA 7 1820
__GPIO_MOCK_DATA 8 1821
__GPIO_MOCK_DATA 9 1820
__GPIO_MOCK_DATA 10 1821
__GPIO_MOCK_DATA 11 1820
__GPIO_MOCK_DATA 12 1821
__GPIO_MOCK_DATA 13 1820
__GPIO_MOCK_DATA 14 1821
__GPIO_MOCK_DATA 15 1820