Created
April 5, 2019 08:19
-
-
Save yamori813/63c4b9cc841530003ad0ee6842ea653b to your computer and use it in GitHub Desktop.
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
def copylcd(c, sp) | |
for n in 1..64 do | |
rgba = c.getpix(0, n - 1, 128) | |
for i in 1..16 do | |
pat = 0 | |
for k in 1..8 do | |
if rgba[1 + (i - 1) * 4 * 8 + (k - 1) * 4] == 0xff | |
pat |= 1 << (8 - k) | |
end | |
end | |
bytestr = " " | |
bytestr.setbyte(0, pat) | |
sp.write bytestr | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment