Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


C++

Blocks

Code Block
languagecpp
themeConfluence
int buttonState = 0;
int LEDPin = 11;
 
void setup()
{
  // initialize pin 2 as input and pin 11 as output
  pinMode(2, INPUT);
 
  pinMode(LEDPin, OUTPUT);
}
 
void loop()
{
  buttonState = digitalRead(2); // read the button
  if (buttonState == HIGH) {
    // do something - here we just blink the LED
    digitalWrite(LEDPin, HIGH);
    delay(500);
    digitalWrite(LEDPin, LOW);
    delay(500);
  }
}
]] ></ac:plain-text-body></ac:structured-macro></div></td><td><div class="content-wrapper"><p><ac:image ac:height="250"><ri:attachment ri:filename="image2020-1-20_22-2-32.png" /></ac:image></p></div></td></tr></tbody></table>


image2020-1-20_22-2-32.pngImage Added