This circuit was a part of my Computer Science Discoveries Class curriculum. The components include:
- Arduino UNO
- A breadboard
- wires
- 200 ohm resistors
- A pushbutton
- An LED

The Arduino code for this circuit is shown below.
int buttonState = 0;
void setup()
{
pinMode(2, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
// read the state of the push button
buttonState = digitalRead(2);
// checks if pushputton is pressed
if (buttonState == HIGH) {
digitalWrite(LED_BUILTIN, HIGH);
} else {
digitalWrite(LED_BUILTIN, LOW);
}
delay(10); // Delay a little bit to improve simulation performance
}
