Introduction: Lab 1 CSCI 1200
This Lab shows how to connect LEDs and Pushbuttons to a breadboard and an Arduino. The code provided at the end will allow the LEDs to be controlled by the Pushbuttons.
Step 1: Add an LED
1. Place any color LED into the breadboard.
2. Connect a Jumper Wire from the GND pin on the Arduino to the grounded rail (-) on the breadboard.
3. Connect a Jumper Wire from the grounded rail to the negative lead (shorter lead of the LED).
4. Connect a 220 Ohm resistor from the 12 pin on the Arduino to the positive lead (longer lead of the LED).
Step 2: Add Second LED
1. Place another LED into the breadboard
2. Connect a jumper wire from the grounded rail to the negative lead of the LED.
3. Connect a 220 Ohm resistor from the 10 pin of the Ardunio to the positive lead of the LED.
Step 3: Add a Pushbutton
1. Attach a pushbutton onto the breadboard. One side of the connectors will be placed in the E column of the breadboard and the other side will be placed in the F column.
2. Connect a 10k Ohm resistor from the bottom side of the button to the grounded rail.
3. Connect a Jumper Wire from the power rail of the breadboard to the the top section of the pushbutton.
4. Connect a Jumper Wire from the 6 pin on the Arduino to the bottom section of the pushbutton on the right side of the breadboard.
5. Connect a Jumper Wire from the 5V pin on the Arduino to the Power rail of the breadboard.
Step 4: Add a Second PushButton
1. Steps for connecting the Second button are the same as in Step 3, except the Jumper Wire will be connected into 4 pin and then connected to the bottom section of the button on the right side of the breadboard.
Step 5: Code for Lab 1
Attached is the code for this Lab. The code allows the top button to turn on both LEDs by pressing and holding the button. The bottom button will cause the LEDs to turn on and off in a pattern as long as the button is held down.