Tutorial 3: Digital InputsReceiving inputs is just as important as creating outputs. In this tutorial I show you how to receive and read a digital input from a push button.What you need... Arduino Uno USB-A – USB-B Cable Breadboard Push Button 4,700 – 10,000 ohm Resistor Breadboard compatible wires DIFFICULTYEASY CIRCUITRY KNOWLEDGELITTLE C++ PROGRAMMINGLITTLE ABOUT0MINUTESWhat you will learn... How to build a simple button circuit How to use the digitalRead Arduino command The code...You can copy / paste the code below if you’re having issues with typos or want a shortcut. However I recommend that you follow along in the tutorial to understand what is going on! int buttonPin = 8 ; int LEDPin = 13 ; bool buttonPress ; void setup() { pinMode(LEDPin, OUTPUT) ; pinMode(buttonPin, INPUT) ; } void loop() { buttonPress = digitalRead(buttonPin) ; if (buttonPress) { digitalWrite(LEDPin, HIGH) ; delay(1000) ; } else { digitalWrite(LEDPin, LOW) ; } } PreviousNext