--Function to read value from analog register function ReadRegister(device, analogPin) local inst = mc.mcGetInstance() local hreg = mc.mcRegGetHandle(inst, string.format("%s/Analog input %s", device, analogPin)) return mc.mcRegGetValueString(hreg) end --Function to set FRO value function SetFRO(analog) local percent = analog/1*250 --calculate percentage from 0% to 250% local inst = mc.mcGetInstance() mc.mcCntlSetFRO(inst, percent) end --Main local device = "PoKeys" --Change this to the name of your PoKeys device local analogPin = "45" --Analog input pin number analogVal = ReadRegister(device, analogPin) --Save analog register value in variable SetFRO(analogVal) -- Set FRO value in %