From the course: Learning Arduino: Interfacing with Hardware

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

The shiftOut command

The shiftOut command - Arduino Tutorial

From the course: Learning Arduino: Interfacing with Hardware

Start my 1-month free trial

The shiftOut command

- Okay, so for the command that we're using in order to code the shift register, is a shiftOut command. ShiftOut command simply shifts out bits of data one at a time, so starting from either the most significant, or the least significant. The command has the following syntax: so you start with a dataPin, clockPin, and then the bitOrder if you're doing most significant or least significant, and finally, the data. So let's go ahead and do the coding for it. Okay, so this is the shiftOut. Then we write down the dataPin, clockPin. Now in the bit order, it's either most significant or least significant. The way we did the wiring was for the most significant bit, so we go with most significant bit first, and then finally the data that we'd like to show. And in our case, we're trying to show the numbers that you see in line nine to ten. So I'm going to go ahead and write down the array name. So now since I want to show the numbers from zero to nine, so I want to go through the array, I want…

Contents