const int LED=3;
const int sw =4;
void setup() {
pinMode(LED,OUTPUT);
pinMode(sw,INPUT);
// put your setup code here, to run once:
}
void loop()
{
int data;
data=digitalRead(sw);
if (data==1)
{
digitalWrite(3, HIGH);
}
else
{
digitalWrite(3, LOW);
}
// put your main code here, to run repeatedly:
}