#define pinswitch 2
#define pinrelay 3
void setup() {
// put your setup code here, to run once:
pinMode(pinswitch, INPUT_PULLUP);
pinMode(pinrelay,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int ss_switch =digitalRead(pinswitch);
if(ss_switch==0){
digitalWrite(pinrelay,HIGH);
}else{
digitalWrite(pinrelay,LOW);
}
}