Tuesday, October 9, 2012

Shift Register Lab

     There is one key question that comes up at times when working with an Arduino. What happens if you need to hook up more components to your Arduino than you have pins for. In the recent labs, this was not a problem since we only hooked up a few components at a time. The shift registers used in this lab were used to control 8 bits at a time. This means that you can control 8 bits an only take up a few pins on the Arduino. This works by a process called synchronous serial communication. This means you can pulse one pin up and down by communicating a data byte to the register bit by bit.
     For our first shift register, we were asked to hook up 8 red LED's and 8 220 ohm resistors to our Arduino. The short pin was connected to ground and the other pins were connected to the shift register. Power along with ground was applied to the shift register by using the necessary connections as described in the directions. By using a shift register, we were able to hook up 8 LED's while only taking up 3 DigitalPins on our Arduino.
    This is the "Hello World" example program for the first shift register.

     When we began adding the second shift register, the same steps were used, but we used green LED's so that we could see the difference in the two sets of examples.
     We ran into a few problems when creating our shift registers. The major problem was basically wiring it up. There are many wired needed to hook up a single shift register. When adding the second register, the number of wires was insane.

No comments:

Post a Comment