This shows you the differences between two versions of the page.
|
arduino:advanced_io:shiftout [2013/02/15 18:10] 127.0.0.1 external edit |
arduino:advanced_io:shiftout [2024/02/16 01:04] (current) |
||
|---|---|---|---|
| Line 27: | Line 27: | ||
| ====Note ==== | ====Note ==== | ||
| - | The **dataPin** and **clockPin** must already be configured as outputs by a call to [[pinMode]](). | + | The **dataPin** and **clockPin** must already be configured as outputs by a call to [[pinMode]]. |
| **shiftOut** is currently written to output 1 byte (8 bits) so it requires a two step operation to output values larger than 255. | **shiftOut** is currently written to output 1 byte (8 bits) so it requires a two step operation to output values larger than 255. | ||
| - | (:source lang=arduino tabwidth=4:) | + | <code arduino> |
| // Do this for MSBFIRST serial | // Do this for MSBFIRST serial | ||
| Line 46: | Line 46: | ||
| shiftOut(dataPin, clock, LSBFIRST, (data >> 8)); | shiftOut(dataPin, clock, LSBFIRST, (data >> 8)); | ||
| - | (:sourceend:) | + | </code> |
| Line 53: | Line 52: | ||
| ====Example ==== | ====Example ==== | ||
| - | ''For accompanying circuit, see the [[Tutorial/ShiftOut | tutorial on controlling a 74HC595 shift register]].'' | ||
| - | (:source lang=arduino tabwidth=4:) | + | <code arduino> |
| //**************************************************************// | //**************************************************************// | ||
| // Name : shiftOutCode, Hello World // | // Name : shiftOutCode, Hello World // | ||
| Line 92: | Line 90: | ||
| } | } | ||
| - | (:sourceend:) | + | </code> |