Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95797

Re: RPI.GPIO Help

From Tim Daneliuk <tundra@bogus-city.tundraware.com>
Newsgroups comp.lang.python
Subject Re: RPI.GPIO Help
Date 2015-08-31 14:07 -0500
Organization A noiseless patient Spider
Message-ID <e9lebc-nmi2.ln1@oceanview.tundraware.com> (permalink)
References <lG5Ax.73238$E26.47630@fx20.iad>

Show all headers | View raw


On 08/16/2015 02:40 PM, John McKenzie wrote:
> 
>  Hello, all. I am hoping some people here are familiar with the RPi.GPIO 
> python module for the Raspberry Pi.


I am not familiar with the module, but I am quite familiar with dealing
with hardware interfacing, mostly in assembler.

One thing you need to ensure is that either the module or your
code implents software debounce.  When a button is pressed or switched moved,
there is mechanical bounce for a some period of time immediately thereafter.
In the time right after the switch/button is pressed, the mechanical closure
"bounces" between "on" and "off" for a little while, until it settles down
to the position you've selected.

The idea is to use the initial change of state to initiate the button handling logic but
wait until the switch/button settles down to it's final (and therefore, reliable) state. 

One algorithm to do this is to wait a fixed amount of time after the initial event - say,
100ms - before reading the switch.  The other way to do is to read the button/switch state
ever few milliseconds and only accept the input if it has not changed in, say,
5 measurements.

HTH,

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-08-16 19:40 +0000
  Re: RPI.GPIO Help MRAB <python@mrabarnett.plus.com> - 2015-08-16 21:15 +0100
    Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-08-20 15:12 +0000
      Re: RPI.GPIO Help MRAB <python@mrabarnett.plus.com> - 2015-08-20 16:45 +0100
        Re: RPI.GPIO Help alister <alister.nospam.ware@ntlworld.com> - 2015-08-20 15:54 +0000
      Re: RPI.GPIO Help Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-08-20 21:27 -0400
        Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-08-28 17:40 +0000
          Re: RPI.GPIO Help hakugin.gin@gmail.com - 2015-08-28 13:56 -0700
          Re: RPI.GPIO Help Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-08-29 14:21 -0400
  Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-08-31 17:41 +0000
    Re: RPI.GPIO Help hakugin.gin@gmail.com - 2015-08-31 11:25 -0700
    Re: RPI.GPIO Help MRAB <python@mrabarnett.plus.com> - 2015-08-31 19:34 +0100
    Re: RPI.GPIO Help Johannes Bauer <dfnsonfsduifb@gmx.de> - 2015-09-01 10:58 +0200
  Re: RPI.GPIO Help Tim Daneliuk <tundra@bogus-city.tundraware.com> - 2015-08-31 14:07 -0500
    Re: RPI.GPIO Help Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-09-01 02:08 -0400
  Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-09-02 18:50 +0000
  Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-09-09 19:03 +0000
    Re: RPI.GPIO Help MRAB <python@mrabarnett.plus.com> - 2015-09-09 20:29 +0100
  Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-09-10 15:56 +0000
    Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-09-11 18:24 +0000
      Re: RPI.GPIO Help MRAB <python@mrabarnett.plus.com> - 2015-09-11 19:49 +0100
      Re: RPI.GPIO Help hakugin.gin@gmail.com - 2015-09-11 12:00 -0700
      Re: RPI.GPIO Help hakugin.gin@gmail.com - 2015-09-11 12:24 -0700
      Re: RPI.GPIO Help Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-09-11 21:10 -0400
  Re: RPI.GPIO Help John McKenzie <davros@bellaliant.net> - 2015-09-13 06:08 +0000
    Re: RPI.GPIO Help Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-09-13 12:24 -0400
    Re: RPI.GPIO Help hakugin.gin@gmail.com - 2015-09-14 05:53 -0700

csiph-web