I know I must be doing something stupid here but I cant seem to find a solution, I am trying to have a simple switch in my circuit. I have made a simple switch programme to see where my issue is with no avail;
#include <stdio.h>
#include <wiringPi.h>
int main (void)
{
wiringPisetup () ;
pinMode (4, INPUT) ;
if (4==1) {
printf ("button pressed");
}
return 0;
}
I have one wire connected to one side of button going to gpio 23 ( WiringPi pin 4) and the other going to ground, nothing is happening.