just normally attached without any resistor. But i don't see that as a problem as the base code i made beforehand
boolean check=true;
int buttonState = 1;
const int buttonPin =2;
int PIR = 7;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(buttonPin, INPUT);
digitalWrite(buttonPin, HIGH);
pinMode (PIR,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, check);
buttonState = digitalRead(buttonPin);
int sense = digitalRead (PIR);
delay(500);
if (buttonState == HIGH){
check = false;}
else if (buttonState == LOW)
{if(check == true){;}
else if(sense == HIGH){check = true;}}
}
the problem is that the boolean become stuck to true after i add the Radiohead code. But, i dont know if the button is the problem