I downloaded and installed the open-source Arduino software for my Arduino Duemilanove ATmega328 USB board, and set up my breadboard with a switch (digital input) and two LEDs (digital outputs), and some resistors. I used a 10-ohm resistor for the switch, and 220-ohm resistors for my yellow and red LEDs.

Digital input/output with Arduino

Digital input/output with Arduino

Using code from the lab exercise, I programmed the microcontroller to read the input from the switch (on or off), and then turn the yellow LED on if the input is high, or turn the red LED on if the input is low.

Pressing the switch

Pressing the switch

Note: At first I tried to use a slider switch, but for some reason I couldn’t get it to work with a slider switch. Why? Dunno. So I changed switches to the red push button switch, and it worked.

I also did this lab a second time with Avery – hey two is better than one! It was fun to collaborate, and to talk through the schematic of the circuit together. It was also interesting to note the differences that we experienced when we were doing the lab together versus when I did it alone. Observation 1: We were able to do the lab with two people in half the time it took me to do it alone. Observation 2: My pcomp lab kit has slightly different materials than the newer lab kits, and I found the newer lab kit materials to be slightly lower quality, in particular the wires, push-button switch, and breadboard seemed very flimsy. Avery and I didn’t have to solder anything from his kit, but I had to solder some of the components from my kit. It was fun doing the lab with a friend, and we learned a lot about each other in the process – I highly recommend it!


No Responses to “Lab – Digital Input & Output with Arduino”  

  1. No Comments

Leave a Reply