flm01/mote/v1/openwrt/package/flukso/src/load.lua

15 lines
297 B
Lua
Raw Normal View History

#! /usr/bin/env lua
require 'socket'
local fd = assert(io.open('/dev/ttyUSB0', 'w'))
for i = tonumber(arg[1]), tonumber(arg[2]) do
local data = 'pls ' .. arg[3] .. ':' .. string.sub(string.rep('0', 10) .. i, -10, -1) .. '\n'
fd:write(data)
socket.select(nil, nil, 0.001)
end
fd:close()