[arduino-tutorial] 74HC595 Shift Register IC by ossilampe

Cloned from Sketch [arduino-tutorial] 74HC595 Shift Register IC by mi.vasilakis

This sketch is missing a short description
How to control the 74HC595 shift register IC with Arduino More info: http://www.ardumotive.com/how-to-use-a-shift-register-en.html Introduction In this tutorial you will learn how to use a shift register (or serial to paralled controller). The shift register will give to your Arduino an additional 8 digital outputs, by using only 3 pins on your board In this tutorial you will practice by using the shift register with Arduino uno to control 8 LEDs. So, let’s get started! What you will need For this tutorial you will need: Arduino uno Breadboard Shift Register IC (74HC595) 4x Red LEDs 4x Green LEDs 8x 330 Ohm (or 220) resistors The Circuit ![enter link description here](http://cdn.instructables.com/FG9/72VS/IC37DCSQ/FG972VSIC37DCSQ.LARGE.jpg) ![enter link description here](http://cdn.instructables.com/FIA/838E/IC37DEEI/FIA838EIC37DEEI.LARGE.jpg) The connections are easy, see the image above with the breadboard circuit schematic. You can find more info about IC here: datasheet **The Code** ![enter link description here](http://cdn.instructables.com/F0D/ZNSG/IC37DK8W/F0DZNSGIC37DK8W.MEDIUM.jpg) Here’s the code, embedded using codebender! We will use example sketch from ShiftRegister74HC595.h library. ** How it works:** sr.setAllHight(); Turn all LEDs on sr.setAllLow(); Turn all LEDs off sr.set(i, HIGH); Turn LED i on ( 0 < i < 7) uint8_t pinValues[] = { B10101010 }; sr.setAll(pinValues); Binary to turn on 2nd,4th,6th and 8th LED Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino with this sketch. And that’s it, you’ve programmed your Arduino board! You can make your own modifications to the code by clicking the “Edit” button. For example, try to change line: uint8_t pinValues[] = { B10101010 }; with uint8_t pinValues[] = { B11001100 }; **Well done!** ![enter link description here](http://cdn.instructables.com/F02/I4WO/IC37DKAP/F02I4WOIC37DKAP.MEDIUM.jpg)

Embed This Sketch

Use the following HTML code to embed the sketch code above in your blog or website.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:296790" frameborder="0"></iframe>

Embed The Serial Monitor

You can also embed the Serial Monitor section! Just use this HTML code.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>