Skip to main content

How to use Lua scripts

First use

IfError you0x06070010 cannotwhen loadloading a script intomay emDrive Configurator and you get error 0x06070010, then check ifindicate Lua object 0x2040 0x01 isisn't set to 1. IfTo thatresolve, isensure notproper theaccess case you need to unlock the featurelevel in Configurator to unlock this feature. If you do thatnot u needhave the proper access level.level contact us.

image.pngimage.png

image.pngimage.png

Pro

Best practices

For

further

insights and practical tips, I recommend exploring "Programming in Lua," available at: https://www.lua.org/gems/sample.pdfProgramming in Lua. Authored by experts in the field, this comprehensive resource offers invaluable guidance for Lua developers. It's worth noting that the entire book is accessible free of charge as of April 24, 2024.

 

Minimizing Global Variables

In Lua scripting, it's imperative to exercise caution with global variables to prevent memory exhaustion and script failures, especially on embbeded systems. Emphasizing the utilization of local variables whenever possible is paramount. By minimizing global variable usage, we mitigate the risk of memory overflow and enhance script performance.

Example:

myGlobalVaribale = 10  --Global variable
local myLocalVaribale = 10  --Local variable

 

Issues

If IO.Print() functionisn't does not workfunctioning, it couldmay besignal thatan outdated firmware version. Firmware 0x10C01 lacks support, while 0x10D02 enables the firmware version of the drive is not the latest one. Revision number 0x10C01 does not work with this function, the later one 0x10D02 does.function.