void setup() { // put your setup code here, to run once: pinMode(13, OUTPUT); pinMode(3, INPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: if (digitalRead(3) == LOW) { digitalWrite(13, HIGH); delay(10); } else { digitalWrite(13, LOW); delay(10); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter