Created
October 10, 2011 03:00
-
-
Save stevenocchipinti/1274548 to your computer and use it in GitHub Desktop.
Control LEDs with a parallel port
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
p = open('/dev/port', 'w') | |
p.sync = true | |
sequence = [ | |
0b00000000, | |
0b00000010, 0b00001010, 0b00101010, | |
0b10101010, | |
0b00101010, 0b00001010, 0b00000010, | |
0b00000000, | |
0b00000001, 0b00000101, 0b00010101, | |
0b01010101, | |
0b00010101, 0b00000101, 0b00000001, | |
0b00000000, | |
] | |
3.times do | |
sequence.each do |s| | |
p.seek(0x378, IO::SEEK_SET) | |
p.putc(s) | |
sleep 0.1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment