Code: Select all
hw_dial_add("Your encoder", function(direction)
if direction == 1 then
si_command("ENCODER/1/CW")
elseif direction == -1 then
si_command("ENCODER/1/CCW")
end
end)
Code: Select all
si_command_subscribe("ENCODER/1/CW", function()
print"Encoder 1 rotated clockwise"
end)
si_command_subscribe("ENCODER/1/CCW", function()
print"Encoder 1 rotated counter clockwise"
end)