int sp=7;
int led=8;
int a;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(sp, INPUT);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
a=digitalRead(sp);
Serial.println(a);
if(a==1){
digitalWrite(led, HIGH);
}
else{
digitalWrite(led, LOW);
}
}