First of all, test the LED by connecting it to 3V3 and GND to make it come on without needing code. Then move from 3V3 to a GPIO pin and make sure you know which pin you're connected to. Refer to pinout.xyz.
Your gpiozero example is wrong. Running led.blink() in a loop is repeatedly starting the loop but never giving it chance to cycle. You can either create ...
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 ...
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.
I have had this issue myself.
What you are after is a mock library. Give this one a go:
pip install Mock.GPIO
Just replace your import:
import RPi.GPIO as GPIO
import Mock.GPIO as GPIO
I would go with the RPi.GPIO on the Raspi. Which Version of Raspberry Pi you have?
Two things that came up to my mind by reading your post were:
Have you checked that the LED is working? Connect it with a Resistor which fits your led. If Resistor is to high the LED maybe flashing not very bright. Have you checked that you use the LED in the proper way (not ...
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 ...
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, ...