Skip to content

Instantly share code, notes, and snippets.

@profburke
Last active August 29, 2015 14:05
Show Gist options
  • Save profburke/1aa10b0fd6a2422e1843 to your computer and use it in GitHub Desktop.
Save profburke/1aa10b0fd6a2422e1843 to your computer and use it in GitHub Desktop.
Overriding the default signaling functions in the Morse module. The message is flashed out by a blink(1) device I have attached to my laptop.
morse = require 'morse'
blink = require 'blink'
d = blink.open()
dotLength = 100 -- milllis
morse.setDotGenerator(function()
d:blue()
blink.sleep(dotLength)
d:off()
end)
morse.setDashGenerator(function()
d:blue()
blink.sleep(3 * dotLength)
d:off()
end)
morse.setBlankGenerator(function()
blink.sleep(dotLength)
end)
morse.setCleanupFunction(function()
d:off()
end)
morse.send "Programming Lua is loads of fun!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment