// James Rutter | 23.03.2021 // Fab Academy Week 09: Embedded Programming const int ledPin = 4; const int buttonPin = 3; int buttonValue = 0; // initialize state of button to false/off. void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT); } void loop() { buttonValue = digitalRead(buttonPin); // read in value/state of button if(buttonValue == 1){ digitalWrite(ledPin, HIGH); // if button is pressed (1), turn on LED } digitalWrite(ledPin, LOW); // otherwise leave LED off }