I explain.
I bought a button like this:

And cable to connect to GPIO.
One go to GND and the other on a pin (i know the forbidden pin, i guess).
I have a python script to show me if i push-on it is 1 or it is 0. With this one:
Code: Select all
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import RPi.GPIO as GPIO, time
import time
GPIO.setmode(GPIO.BCM)
BUTTON1 = 2
GPIO.setup(BUTTON1, GPIO.IN)
while True:
print GPIO.input( BUTTON1 ) Like with the button 3.
But with any other: Like GPIO 10 or 9 or any others
I push-on -> 1 -> Ok working.
I push-off -> 10 00 11 01010101. no working. It make anything, he changes alone -> 00 100001111010111111000.
I don't know why.
I ask me, if i connect to the good pin ?
Could you help me plz ?
Thank a lot.
PS. I have a raspberry PI B and i use this schema to help me with pins.

Best Regards.