Created
February 4, 2021 00:19
-
-
Save trentgill/1b83d8bb71a88b39c2146fffe46806b1 to your computer and use it in GitHub Desktop.
demonstrating crow.loadscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- crowy: this script runs on crow | |
function init() | |
print '~crowy~' | |
metro[1].event = function(v) print("tick: "..v) end | |
metro[1]:start() | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- upload | |
-- takes a lua file as argument and sends it to crow | |
-- can save to crow's internal flash with the optional 'flash' arg | |
function init() | |
crow.loadscript(script_dir().."crowy.lua") | |
end | |
-- get location of this script | |
function script_dir() | |
local path = debug.getinfo(2, "S").source:sub(2):reverse() | |
local name = path:find("/") | |
return path:sub(name):reverse() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment