New answers tagged

3

The stated question is regarding contact bounce. However, the data presented in the question does not reflect contact bounce - contact bounce does not repeat over the 100msec & 300msec durations presented in the text of the question. Let me try to be clear: The data provided does not rule out contact bounce, but the issue described by the data is not due ...


2

Your Question is misleading. Debounce settings work for their intended purpose (short term contact bounce), but this is not really your problem. Incidentally if you wanted to test bounce you couldn't have found a better "switch" to generate it - proper switches are designed to minimise bounce, although relay contacts are notorious for bounce. What ...


2

I have written several GPIO Python modules. They each implement a "proper" debounce. pigpio set_glitch_filter lgpio gpio_set_debounce_micros rgpio gpio_set_debounce_micros


0

Here is a script I call waitswitch, which runs the command specified in its argument every time a mechanical switch is pressed. It is based on the example from RasPi.TV. Ideally it should be rewritten so that the pin number to listen on is specified via a command-line option, as well as the "on" value and the pull-up direction. There are also some ...


1

I have had this issue myself. What you are after is a mock library. Give this one a go: https://pypi.org/project/Mock.GPIO/ pip install Mock.GPIO Just replace your import: import RPi.GPIO as GPIO with: import Mock.GPIO as GPIO


2

The RPi.GPIO module only runs on the Raspberry Pi. You will have to create your own dummy copy if you want to develop on another computer.


1

Driving a 3.3V pin with a 12V signal will require a level shifter anyway, and inverting level shifters have essentially the same complexity as non-inverting ones. For instance, here's an example using an optocoupler: simulate this circuit – Schematic created using CircuitLab The advantage of an optocoupler is that you don't have to have the same ...


1

EDIT: I have missed the pulldown resistor in my illustration for the accessories to ground. Don't forget that or you will get a floating value when the car is on! I know this is old but in the off chance it helps someone, I thought I might share my solution. I'm pretty new to all of this so please, if I am doing anything stupid, let me know. A small, ...


0

I've devleoped this from Bill Kronholm's above: # Toggle a latching momentary button, using interrupts on the RPi. # Developed from: how to turn on and off an led with only a tactile button # By Bill Kronholm - 12-June-2014 # Documentation: https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/ # This version by Rob Thomas, Digi Teacher, Glenunga ...


Top 50 recent answers are included