User avatar
clemsy
Posts: 7
Joined: Sat Aug 18, 2018 9:44 am

buttons and pull resistors

Sun Aug 26, 2018 7:58 pm

Hi All

I started a Score Board project for my Bike Polo club with my friend Lucas... ( intro :D )

It's written in python (really beginner with that language)

I use 7 segments leds stripes for the timer/countdown and score for each team
this is working quite good

I control the time limit, start/pause the timer, score, reset... with a pannel with some buttons (switches and push buttons) and also have a monitoring LCD screen (16x2)

The problem I have is when I push a button ( lets say start/pause ) it works, but, at some times some other methods are called.

It can add goals for a team, change the time limit or whatever.

Sometimes it works all perfectly...

I dont have any resitors for the buttons and read today about pull up/down resistors and do not really undeerstand if it can solve my strange behaviors and also what kind and where do I have to put it...

what do you think? o



Here is the code : https://github.com/clemsy/poloboard/blo ... loboard.py

I dont have a schema for the scoreboard but some photos

Image
the left team score is not working because of the shit register is ko
that is also a strange thing, we have like 10 shift register dead.. why ? how ?

Image
the pcb for each led pannel

Image
behind the box

Image
gpio output

Image
the control pannel

User avatar
clemsy
Posts: 7
Joined: Sat Aug 18, 2018 9:44 am

Re: buttons and pull resistors

Sun Aug 26, 2018 8:18 pm

output of the console when I only switched start / stop and it add goals when the timer goes on

Code: Select all

[email protected]:~/python/poloboard $ sudo python poloboard.py 
10:00
09:59
09:58
09:57
09:56
Paused
 -1
09:55
09:54
09:53
09:52
09:51
09:50
Paused
 09:49
-1
Paused
 09:48
-1
09:47
Paused
 09:46
-1
09:45
09:44
09:43


PhatFil
Posts: 1436
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: buttons and pull resistors

Sun Aug 26, 2018 8:30 pm

nice project, this should explain the how/why and when to use internal or external pull up/down resistors https://raspi.tv/2013/rpi-gpio-basics-6 ... pull-downs

10 x dead shift registers?? bought from a far east portal at a rock bottom price?

User avatar
clemsy
Posts: 7
Joined: Sat Aug 18, 2018 9:44 am

Re: buttons and pull resistors

Sun Aug 26, 2018 8:36 pm

10 x dead shift registers?? bought from a far east portal at a rock bottom price?
I think yes...

User avatar
clemsy
Posts: 7
Joined: Sat Aug 18, 2018 9:44 am

Re: buttons and pull resistors

Mon Aug 27, 2018 7:26 am

thanks for the article it is very clear :)

I understand the need of the pull up/dow resistors but still not sure of where I have to place it and wich capacity?

User avatar
clemsy
Posts: 7
Joined: Sat Aug 18, 2018 9:44 am

Re: buttons and pull resistors

Mon Aug 27, 2018 7:53 am

I just changed add_event_detect to FALLING instead of BOTH and it seems to be OK now? Is it right or is it just random?

Return to “Troubleshooting”