Introduction: First Steps With Processing and Arduino (controlling Shift Register From Computer)

About: Just a beginner.

Hey again! I have just a few parts, so i decided to start building virtual! I had processing on my computer, but i had never used it, because i´m just a student and i don´t know Java at all. First i decided to draw square. I had soo much problems with it, but i finally made it! I got black square to my screen! It was pretty funny, because i don´t usually "celebrate" this primitive things.

Now i´m showing you how to build application that can control shift register with Processing and Arduino!

Btw you can find processing from here:

Step 1: Processing Coding

Okay. Now i´m showing how to use processing to create squares, text and send clicks to Arduino. I have made this code earlier today, and i didn´t record it. I hope you get something of that video, because i can´t explain anything what i´m doing in processing.


Oh shit... I forgot to give you the processing code! Sorry about that! Here you go:

Step 2: Arduino Code

Okay. Now we have code in processing, so next thing we do is creating Arduino code.

I´m not making video about it, but i´m pasting the code right here:


int dataPin = 3; //dataPin = 3

int clockPin = 4; //clockPin = 4

int latchPin = 5; //latchPin = 5

int value = 0;

void setup() {

pinMode(dataPin, OUTPUT); //put dataPin to output pin

pinMode(latchPin, OUTPUT); //put latchPin to output pin

pinMode(clockPin, OUTPUT); //put clockPin to output pin

Serial.begin(9600); // start serial communication, speed is 9600 baud


void loop() {

if(Serial.available() > 0) { //if we got some data

value =; //store data to value


digitalWrite(latchPin, LOW); //put latch LOW, so we can´t see flickering

shiftOut(dataPin, clockPin, MSBFIRST, value); //shift value out to the shiftregister

digitalWrite(latchPin, HIGH); //put latch back on, so we can see the leds


Step 3: Building Hardware

Now we have to build it up. I used in this project Texas Intrument´s HC74595N shift register.

There you can find good tutorial about hc595:

Now we are ready. You can check my video about this project, but i embed it to introducion(or first step).

Make It Glow! Contest

Participated in the
Make It Glow! Contest