From 84f447639bf993749cd8c0d1a655b5375875b29d Mon Sep 17 00:00:00 2001 From: Sergey Karmanov Date: Thu, 6 Apr 2023 20:47:54 +0300 Subject: [PATCH] Add example --- example/shiftOut_example.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 example/shiftOut_example.lua diff --git a/example/shiftOut_example.lua b/example/shiftOut_example.lua new file mode 100644 index 0000000..dd136a7 --- /dev/null +++ b/example/shiftOut_example.lua @@ -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)