Some kind of message
This commit is contained in:
954
font5x8.bin
Executable file
954
font5x8.bin
Executable file
File diff suppressed because one or more lines are too long
BIN
fonts/FreeMonoBold.ttf
Normal file
BIN
fonts/FreeMonoBold.ttf
Normal file
Binary file not shown.
32
framebuf-test.py
Normal file
32
framebuf-test.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
"""
|
||||||
|
Be sure to check the learn guides for more usage information.
|
||||||
|
|
||||||
|
This example is for use on (Linux) computers that are using CPython with
|
||||||
|
Adafruit Blinka to support CircuitPython libraries. CircuitPython does
|
||||||
|
not support PIL/pillow (python imaging library)!
|
||||||
|
|
||||||
|
Author(s): Melissa LeBlanc-Williams for Adafruit Industries
|
||||||
|
"""
|
||||||
|
import board
|
||||||
|
import neopixel
|
||||||
|
from PIL import Image
|
||||||
|
from adafruit_pixel_framebuf import PixelFramebuffer
|
||||||
|
|
||||||
|
pixel_pin = board.D18
|
||||||
|
pixel_width = 8
|
||||||
|
pixel_height = 16
|
||||||
|
|
||||||
|
pixels = neopixel.NeoPixel(
|
||||||
|
pixel_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False,
|
||||||
|
)
|
||||||
|
pixel_framebuf = PixelFramebuffer(pixels, pixel_width, pixel_height, reverse_x=True,alternating=True)
|
||||||
|
pixel_framebuf.text("Hi", 3, 4, 0x00FF00)
|
||||||
|
pixel_framebuf.display()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
18
piltest.py
18
piltest.py
@@ -21,20 +21,20 @@ def char_to_pixels(text, path, fontsize):
|
|||||||
return arr
|
return arr
|
||||||
|
|
||||||
def display(arr):
|
def display(arr):
|
||||||
result = np.where(arr, '#', ' ')
|
result = np.where(arr, '1', '0')
|
||||||
#print("This gives an Array of Arrays, where reach contained Array is a row")
|
print("This gives an Array of Arrays, where reach contained Array is a row")
|
||||||
#print(result)
|
print(result)
|
||||||
#print()
|
print()
|
||||||
print('\n'.join([''.join(row) for row in result]))
|
print('\n'.join([''.join(row) for row in result]))
|
||||||
|
|
||||||
#I have used static coding successfully, now to set this as more reusable declarations rather than hard coding.
|
#I have used static coding successfully, now to set this as more reusable declarations rather than hard coding.
|
||||||
#Single Source to change for everything
|
#Single Source to change for everything
|
||||||
#Read from file?
|
#Read from file?
|
||||||
fileName = "/home/pi/Documents/pilReadTest"
|
fileName = "pilReadTest"
|
||||||
pullFile = open(fileName,"r")
|
pullFile = open(fileName,"r")
|
||||||
someString = pullFile.read()
|
someString = pullFile.read()
|
||||||
#Font Path?
|
#Font Path?
|
||||||
fontPath = "/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf"
|
fontPath = "fonts/FreeMonoBold.ttf"
|
||||||
#font Size?
|
#font Size?
|
||||||
fontSize = 12
|
fontSize = 12
|
||||||
#print("This was what was found in the File: "+str(someString))
|
#print("This was what was found in the File: "+str(someString))
|
||||||
@@ -43,10 +43,10 @@ fontSize = 12
|
|||||||
#print()
|
#print()
|
||||||
for c in someString:
|
for c in someString:
|
||||||
arr = char_to_pixels(c,fontPath,fontSize)
|
arr = char_to_pixels(c,fontPath,fontSize)
|
||||||
#print()
|
print()
|
||||||
#This is the grid size results (w,h)
|
#This is the grid size results (w,h)
|
||||||
#print(arr.shape)
|
print(arr.shape)
|
||||||
#print()
|
print()
|
||||||
#print("This is the converted values of the AofAs, for each ROW in Result, the end product")
|
#print("This is the converted values of the AofAs, for each ROW in Result, the end product")
|
||||||
display(arr)
|
display(arr)
|
||||||
print()
|
print()
|
||||||
Reference in New Issue
Block a user