// For the Arduino Discord channel.
int ledPin = 5;
int buttonPin = 4;
void setup()
{
Serial.begin(115200);
Serial.println("--------------------------------");
Serial.println("This is the Serial output.");
Serial.println("Press the button to turn led on.");
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop()
{
// HIGH = 1 = true
// LOW = 0 = false
// Therefor "!value" would be enough.
int value = digitalRead(buttonPin);
int led = (value == LOW) ? HIGH : LOW;
digitalWrite(ledPin, led);
delay(50);
}