GPIO - Conflit with button and screen

Having trouble with your GBZ build? Ask your questions here!
Post Reply
User avatar
Marty33
Posts: 145
Joined: Wed Feb 22, 2017 4:55 pm
Has thanked: 19 times
Been thanked: 13 times

GPIO - Conflit with button and screen

Post by Marty33 » Fri Mar 02, 2018 6:29 pm

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... :(

Image

Can you help me ? Big thanks :P

jakejm79
Posts: 129
Joined: Tue Oct 10, 2017 3:40 pm
Has thanked: 1 time
Been thanked: 33 times

Re: GPIO - Conflit with button and screen

Post by jakejm79 » Fri Mar 02, 2018 6:50 pm

Just edit the retrogame.cfg file in the boot partition, pin 25, 24 or 7 would make a good substitute.

User avatar
Marty33
Posts: 145
Joined: Wed Feb 22, 2017 4:55 pm
Has thanked: 19 times
Been thanked: 13 times

Re: GPIO - Conflit with button and screen

Post by Marty33 » 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...

User avatar
moosepr
Posts: 524
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 241 times
Contact:

Re: GPIO - Conflit with button and screen

Post by moosepr » 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
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

User avatar
rodocop
Posts: 1723
Joined: Mon Aug 22, 2016 3:14 pm
Location: Saskatchewan
Has thanked: 606 times
Been thanked: 608 times

Re: GPIO - Conflit with button and screen

Post by rodocop » Sat Mar 03, 2018 5:00 pm

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.

User avatar
Marty33
Posts: 145
Joined: Wed Feb 22, 2017 4:55 pm
Has thanked: 19 times
Been thanked: 13 times

Re: GPIO - Conflit with button and screen

Post by Marty33 » Sun Mar 04, 2018 5:39 am

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 :
Image

User avatar
moosepr
Posts: 524
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 241 times
Contact:

Re: GPIO - Conflit with button and screen

Post by moosepr » Mon Mar 05, 2018 8:51 am

ah ok, you wont be moving those pins anytime soon :P
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest