Changes for page 05 Lua Script

Last modified by Devin Chen on 2025/03/04 14:07

From version 22.1
edited by Hunter
on 2022/12/14 11:43
Change comment: There is no comment for this version
To version 25.1
edited by Hunter
on 2023/03/01 12:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -227,4 +227,16 @@
227 227  (% style="text-align:center" %)
228 228  [[image:MQTTJSONparsefunction.png]]
229 229  
230 += **11 High-Low Byte Switch** =
231 +
232 +Main function is like following:
233 +
234 +{{code language="lua"}}
235 +local lowByte = val & 0x00ff
236 +local shiftHigh = lowByte << 8
237 +local highByte = val & 0xff00
238 +local shiftLow = highByte >> 8
239 +local newVal = shiftHigh|shiftLow
240 +{{/code}}
241 +
230 230