Add sample.lua for the common code

This commit is contained in:
Ceda EI 2019-01-30 23:16:31 +05:30
parent ff5c9d2f76
commit f18b575f00
1 changed files with 22 additions and 0 deletions

22
sample.lua Normal file
View File

@ -0,0 +1,22 @@
position = mem.position
if position == nil then
position = 0
end
position = position + 1
mem.position = position
if pin.b then
if notes[position] == nil then
port = {a=false, b=false, c=false, d=false}
elseif note[position] == 1 then
port = {a=true, b=false, c=false, d=false}
elseif note[position] == 2 then
port = {a=false, b=true, c=false, d=false}
elseif note[position] == 3 then
port = {a=false, b=false, c=true, d=false}
elseif note[position] == 1 then
port = {a=false, b=false, c=false, d=true}
end
else
mem.position = 0
end