Last active
August 29, 2015 14:05
-
-
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.
This file contains 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
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