voltage.lua
otii.clear()
local devices = otii.get_devices("Arc")
assert(#devices > 0, "No available devices")
local box = otii.open_device(devices[1].id)
assert(box ~= nil, "No available otii")
local project = otii.get_active_project()
if project == nil then
project = otii.create_project()
end
assert(project ~= nil, "Cannot create project")
project:enable_main_power(true)
project:start()
for voltage = 1.1, 4.2, 0.1 do
box:set_main_voltage(voltage)
otii.log("Voltage = " .. tostring(voltage))
otii.msleep(1000)
end
project:stop()
project:enable_main_power(false)
box:close()