const int ledpin = 6;
const int button = 1;
int val;
void setup() {
// put your setup code here, to run once:
pinMode(ledpin,OUTPUT);
pinMode(button,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
val = digitalRead(button);
if(val==HIGH)
{
digitalWrite(ledpin,HIGH);
Serial.print("1");
}
else{digitalWrite(ledpin,LOW);
Serial.print("0");}
}