Programming a C / C++ code to Control LEDS existing on BeagleBoneBlack using BUTTON integrated on the Board

13 views
Skip to first unread message

ghass...@gmail.com

unread,
Sep 17, 2019, 8:53:36 AM9/17/19
to BeagleBoard
Hello BBB users. Is there anyone here who developped a C or C++ code which make it possible to Control LED using Button integrated both in the board through GPIO ? Please help me.

TJF

unread,
Sep 17, 2019, 11:44:44 AM9/17/19
to BeagleBoard
This example shows how to control a user LED (LED3):


This example shows how to read the state of a button:


The only onboard button connected to a GPIO is the boot button, wired to P8_43. So you have to adapt #define PIN P8_43. And since the button switches GND, you should use a pull-up resistor: if (pruio_gpio_config(io, PIN, PRUIO_GPIO_IN_1)) {...

Merge both examples together and off you go.
Reply all
Reply to author
Forward
0 new messages