I am wondering if someone could explain to me the following line:
string.sub(payload,kdesi[2]+1,#payload)I understand that kdesi is a variable declared within the function. I just need help with the other items... I don't know the proper terms to google them or I would. A link to explanations would be great as well.
Full function:
function ctrlpower(kdesi,payload)
pwm.close(outpin)
gpio.mode(outpin,gpio.OUTPUT)
dotaz=string.sub(payload,kdesi[2]+1,#payload)
status = dotaz
if dotaz=="ON" then gpio.write(outpin,gpio.HIGH) return end
if dotaz=="OFF" then gpio.write(outpin,gpio.LOW) return end
if dotaz=="FLC" then pwm.setup(outpin,2,512)pwm.start(outpin) return end
pwm.setup(outpin,1000,dotaz*10)
pwm.start(outpin)
end