Page 1 of 1
GPIO - Conflit with button and screen
Posted: Fri Mar 02, 2018 6:29 pm
by Marty33
Hello all
After hard work, i compiled buttons, screen and sound on GPiO.
This tutorial for the buttons :
https://sudomod.com/forum/viewtopic.php?t=57
Screen and sound from previous posts.
BUT, i have conflict with the number 15. Screen and up button...
Can you help me ? Big thanks

Re: GPIO - Conflit with button and screen
Posted: Fri Mar 02, 2018 6:50 pm
by jakejm79
Just edit the retrogame.cfg file in the boot partition, pin 25, 24 or 7 would make a good substitute.
Re: GPIO - Conflit with button and screen
Posted: Fri Mar 02, 2018 7:17 pm
by Marty33
Ho ok.
In retrogame.cfg, i see that :
Code: Select all
// Input Output (from /usr/include/linux/input.h)
{ 23, KEY_LEFT }, // Joystick (4 pins)
{ 0, KEY_RIGHT },
{ 1, KEY_DOWN },
{ 22, KEY_UP },
{ 12, KEY_ENTER }, // START
{ 5, KEY_S }, // SELECT
{ 16, KEY_A }, // A
{ 6, KEY_B }, // B
{ 19, KEY_Y }, // Y
{ 26, KEY_X }, // X
{ 20, KEY_R }, // RT
{ 21, KEY_L }, // LT
{ -1, -1 } }; // END OF LIST, DO NOT CHANGE
The up button is on 22. I don't understand. There's already something that doesn't fit here...
Re: GPIO - Conflit with button and screen
Posted: Sat Mar 03, 2018 10:43 am
by moosepr
What screen are you using? If you using fbtft to drive an SPI screen, you can manually adjust the DC and reset pins for the screen connection
Re: GPIO - Conflit with button and screen
Posted: Sat Mar 03, 2018 5:00 pm
by rodocop
Marty33 wrote: ↑Fri Mar 02, 2018 7:17 pm
Ho ok.
In retrogame.cfg, i see that :
Code: Select all
// Input Output (from /usr/include/linux/input.h)
{ 23, KEY_LEFT }, // Joystick (4 pins)
{ 0, KEY_RIGHT },
{ 1, KEY_DOWN },
{ 22, KEY_UP },
{ 12, KEY_ENTER }, // START
{ 5, KEY_S }, // SELECT
{ 16, KEY_A }, // A
{ 6, KEY_B }, // B
{ 19, KEY_Y }, // Y
{ 26, KEY_X }, // X
{ 20, KEY_R }, // RT
{ 21, KEY_L }, // LT
{ -1, -1 } }; // END OF LIST, DO NOT CHANGE
The up button is on 22. I don't understand. There's already something that doesn't fit here...
For the controls they use the bcm number so 22 = physical pin 15.
Re: GPIO - Conflit with button and screen
Posted: Sun Mar 04, 2018 5:39 am
by Marty33
Okayyyyy ! Big thanks @rodocop
I did a search, if i wired the up on PIN 7 -> physical pin 4 ?
And my code is :
Code: Select all
// Input Output (from /usr/include/linux/input.h)
{ 23, KEY_LEFT }, // Joystick (4 pins)
{ 0, KEY_RIGHT },
{ 1, KEY_DOWN },
{ 7, KEY_UP },
{ 12, KEY_ENTER }, // START
{ 5, KEY_S }, // SELECT
{ 16, KEY_A }, // A
{ 6, KEY_B }, // B
{ 19, KEY_Y }, // Y
{ 26, KEY_X }, // X
{ 20, KEY_R }, // RT
{ 21, KEY_L }, // LT
{ -1, -1 } }; // END OF LIST, DO NOT CHANGE
moosepr wrote: ↑Sat Mar 03, 2018 10:43 am
What screen are you using? If you using fbtft to drive an SPI screen, you can manually adjust the DC and reset pins for the screen connection
Here my screen :

Re: GPIO - Conflit with button and screen
Posted: Mon Mar 05, 2018 8:51 am
by moosepr
ah ok, you wont be moving those pins anytime soon
