You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I don't understand anything about python and I don't know how to fix the problem. Can you help me?
I am using your script.
import sys
import numpy
from PIL import Image
im = Image.open(sys.argv[1])
im = im.convert("1")
rows = (im.size[1] // 8)
cols = im.size[0]
val = ""
print("const int bmap[8]= {")
for p in range(rows):
for xx in range(cols):
for yy in range(8):
pix = im.getpixel((xx,(p * 8) + yy))
if (pix == 0):
val = "1" + val
else:
val = "0" + val
val = "B" + val
print(val + ",", end='')
val = ""
if (xx % 8 == 7):
print("")
print("}")
Thanks. and congratulations. You have greatly reduced the use of atmega328p with your library.
The text was updated successfully, but these errors were encountered:
Hello, how are you?
By converting your font.gif with converter.py I am not getting the same result as you did. Look:
const int bmap [8] = {
B0, B0, B1, B1, B1, B0, B0, B0, B0, B1, B0, B0, B0, B1, B0, B0, B1, B0, B0, B0, B1, B0, B1, B0, B1, B0, B0, B1, B0, B0, B1, B0, B1, B0, B1, B0, B0, B0, B1, B0, B0, B1, B0, B0, B0, B1, B0, B0, B0, B0, B1, B1, B1, B0, B0, B0, B0,
B0,
B0,
B0,
B0,
B0,
B0,
B0,
B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B1, B0, B0, B0, B0, B1, B0, B0, B0, B0, B0, B0, B1, B0, B1, B1, B1, B1, B1, B1, B1, B0, B0, B0, B0, B0, B0, B0, B0, B1, B0, B0, B0, B0, B0, B0, B1, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0,
...
...
...
}
But I don't understand anything about python and I don't know how to fix the problem. Can you help me?
I am using your script.
import sys
import numpy
from PIL import Image
im = Image.open(sys.argv[1])
im = im.convert("1")
rows = (im.size[1] // 8)
cols = im.size[0]
val = ""
print("const int bmap[8]= {")
for p in range(rows):
for xx in range(cols):
for yy in range(8):
pix = im.getpixel((xx,(p * 8) + yy))
if (pix == 0):
val = "1" + val
else:
val = "0" + val
val = "B" + val
print(val + ",", end='')
val = ""
if (xx % 8 == 7):
print("")
print("}")
Thanks. and congratulations. You have greatly reduced the use of atmega328p with your library.
The text was updated successfully, but these errors were encountered: