I am a beginner using a raspberry pi 1 model A+ to create a production counter that would count the material as it would hit the switch and that would be counted as 1. The issue I am having is that I have everything set up but I won't work.
I have NC (red wire connected to Pin 17 a 3V3)
I have NO black wire in pin 1(3V3) and
I have a C connection to a yellow wire connected to a 10k resistor that's connected to the white wire that's connected to the ground.
I have created a small code that would just test the switch through the raspberry pi.
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17,GPIO.IN) print("Press button") while GPIO.input(17)==0: pass print("Thanks") GPIO.cleanup()