2019-01-30 18:46:31 +01:00
|
|
|
position = mem.position
|
|
|
|
if position == nil then
|
|
|
|
position = 0
|
|
|
|
end
|
|
|
|
position = position + 1
|
2019-01-30 18:48:06 +01:00
|
|
|
if position > num_of_notes then
|
|
|
|
position = 1
|
|
|
|
end
|
2019-01-30 18:46:31 +01:00
|
|
|
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
|