Galactic Unicorn, bitmap8 characters too small, how to make bigger?

I think this is what you need. It should be easy to add any extra symbols required at the end of the code.

# 11x8 Numeric Font with Pimoroni Galactic Unicorn

#       Tony Goodhew 12 March 2024

from galactic import GalacticUnicorn
from picographics import PicoGraphics, DISPLAY_GALACTIC_UNICORN
import time
from machine import Pin, I2C
import random

# create a PicoGraphics framebuffer to draw into
graphics = PicoGraphics(display=DISPLAY_GALACTIC_UNICORN)

# create our GalacticUnicorn object
gu = GalacticUnicorn()
#Define some colours
BLACK = graphics.create_pen(0, 0, 0)
RED =  graphics.create_pen(255, 0, 0)
YELLOW = graphics.create_pen(255, 255, 0)
GREEN = graphics.create_pen(0, 255, 0)
CYAN =  graphics.create_pen(0, 255, 255)
BLUE =  graphics.create_pen(0, 0, 255)
MAGENTA =  graphics.create_pen(255, 0, 255)
WHITE =  graphics.create_pen(200, 200, 200)
GREY =  graphics.create_pen(100, 100, 100)
DRKGRY =  graphics.create_pen(20, 20, 20)

colours =[RED,YELLOW,GREEN,CYAN,BLUE,MAGENTA,GREY] # List of colours

graphics.set_pen(BLACK)
graphics.clear()
gu.update(graphics)
graphics.set_pen(BLACK)

powers =[128,64,32,16,8,4,2,1]
code =[
    0b01111110, # 0
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b01111110,
    0b00001000, # 1
    0b00011000,
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000,
    0b01111110,
    0b01111110, # 2
    0b10000001,
    0b00000001,
    0b00000001,
    0b00000001,
    0b01111110,
    0b10000000,
    0b10000000,
    0b10000000,
    0b10000000,
    0b01111110,
    0b01111110, # 3
    0b10000001,
    0b00000001,
    0b00000001,
    0b00000001,
    0b01111110,
    0b00000001,
    0b00000001,
    0b00000001,
    0b10000001,
    0b01111110,  
    0b00000100, # 4
    0b00001100,
    0b00010100,
    0b00100100,
    0b01000100,
    0b10000100,
    0b11111110,
    0b00000100,
    0b00000100,
    0b00000100,
    0b00000100,      
    0b01111111, # 5
    0b10000000,
    0b10000000,
    0b10000000,
    0b10000000,
    0b01111110,
    0b00000001,
    0b00000001,
    0b00000001,
    0b10000001,
    0b01111110,
    0b01111110, # 6
    0b10000001,
    0b10000000,
    0b10000000,
    0b10000000,
    0b01111110,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b01111110,
    0b11111111, # 7
    0b00000010,
    0b00000100,
    0b00001000,
    0b00010000,
    0b00010000,
    0b00100000,
    0b01000000,
    0b01000000,
    0b10000000,
    0b10000000,
    0b01111110, # 8
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b01111110,
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b01111110,
    0b01111110, # 9
    0b10000001,
    0b10000001,
    0b10000001,
    0b10000001,
    0b01111111,
    0b00000001,
    0b00000001,
    0b00000001,
    0b00000001,
    0b00000001,
    0b00011100, # deg
    0b00010100,
    0b00011100,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000, # colon
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000,
    0b00011000,
    0b00000000,
    0b00000000,
    0b00011000,
    0b00000000,
    0b00000000  
    ]

def draw_char(v,xoffset,colour):
    graphics.set_pen(colour)
    start = 11 * v
    for row in range(11):
        q = code[start + row]
        for x in range(8):            
            if q & powers[x] == powers[x]:
                graphics.pixel(x+xoffset, row)

graphics.set_pen(GREEN)
for value in range(12):
    draw_char(value,random.randint(0,45),BLUE)
    gu.update(graphics)
    time.sleep(1)
    graphics.set_pen(BLACK)
    graphics.clear()

gu.update(graphics)

n = 104783
ns = str(n)
l = len(ns)
for p in range(len(ns)):
    v = ord(ns[p])-48
    draw_char(v,9*p,GREEN)
gu.update(graphics)

time.sleep(20)
graphics.set_pen(BLACK)
graphics.clear()
gu.update(graphics)

Best wishes

2 Likes