Back to Parent

nt ledPin = D6;
int buttonPin = D2;

void setup()
{
    pinMode(buttonPin,INPUT_PULLUP);
    pinMode(ledPin,OUTPUT);
}

void loop()
{
    int buttonState = digitalRead(buttonPin);
    if (buttonState == LOW)
    { digitalWrite(ledPin,HIGH);
    }else{
        digitalWrite(ledPin,LOW);
    }
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0