PINE64
Attaching a physical button to the ROCK64 - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85)
+--- Forum: Rock64 Hardware and Accessories (https://forum.pine64.org/forumdisplay.php?fid=89)
+--- Thread: Attaching a physical button to the ROCK64 (/showthread.php?tid=7221)



Attaching a physical button to the ROCK64 - momoster69 - 03-02-2019

Hi All,

I have downloaded the package that allows Python and GPIO interaction: https://github.com/mrfixit2001/Rock64-R64.GPIO

I have a button wired to the Ground pin and the pin 18 (https://www.cnx-software.com/wp-content/uploads/2017/08/Rock64-Pi-2-Bus-Pinout.png)
[/url]
so it looks like I am getting errors with my [url=https://pastebin.com/QpP1wgKH]script
(https://pastebin.com/QpP1wgKH).
errors appear after I ctrl-c in terminal, the two errors are:
Error: Unable to get GPIO value
You must setup() the GPIO channel (BCM 18) first

does anyone know what I am doing wrong?


RE: Attaching a physical button to the ROCK64 - dkryder - 03-03-2019

take a look at this repo. it's a clone with some changes.
https://github.com/Matei-Ciobotaru/Rock64-R64.GPIO


another thing is you could use GPIO.BOARD instead of GPIO.BCM and maybe for test use value 18 instead of button.