19.03.2021, 09:33
You can use 1-byte object with custom values to control values as is (0=off, 4=highest).
Then to convert object value to payload use this:
To convert payload back to the value use this:
Then to convert object value to payload use this:
Code:
payload = 'C,5,' .. value .. '\r\n'
To convert payload back to the value use this:
Code:
value = payload:match('C,%d,(%d)')