Add example
This commit is contained in:
parent
af1f1a2b75
commit
84f447639b
14
example/shiftOut_example.lua
Normal file
14
example/shiftOut_example.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
require("shiftOut")
|
||||||
|
|
||||||
|
LatchPin = 4
|
||||||
|
DataPin = 2
|
||||||
|
ClockPin = 3
|
||||||
|
|
||||||
|
register = shiftOut:new(LatchPin, DataPin, ClockPin)
|
||||||
|
|
||||||
|
register:shiftOut("11000000") -- string value
|
||||||
|
register:shiftOut(192) -- decimal digit value
|
||||||
|
|
||||||
|
-- By default bit order is MSBFIRST, but you can change it to LSBFIRST
|
||||||
|
register:shiftOut("11000000", LSBFIRST)
|
||||||
|
register:shiftOut(192, MSBFIRST)
|
Loading…
x
Reference in New Issue
Block a user