by Fernando Perez » Wed Nov 29, 2023 2:10 pm
I do not propose to create a font editor for maxScroll, but rather an editor of fixed figures that do not scroll (including ASCII characters if necessary), which serve as a template for an independent display system in 8x8 LED matrices, controlled by MAX7219 .
I recovered an old file that I had working a long time ago:
Code: [Local Link Removed for Guests]
dim chars(9, 7)
initCHARS
CS = 5 ' CS=GPIO5 - CLK=GPIO18 - DIN=GPIO23
initMAX CS, 0 ' brightness 0 to 10
for h = 0 to 9
display h
pause 1000
next h
clearMAX
END
' ---------------------------------
SUB initMAX(pinCS, brightness)
SPI.SETUP 1000000
SPI.CSPIN CS
writeMAX &H09, 0 ' 6H09 = MAX7219DECODE
writeMAX &H0A, brightness ' &H0A = MAX7219INTENSITY
writeMAX &H0B, 7 ' &H0B = MAX7219SCANLIMIT
writeMAX &H0F, 0 ' &H0F = MAX7219TEST; 0 = TESTMODEOFF
writeMAX &H0C, 1 ' &H0C = MAX7219SHUTDOWN; 1 = MAX7219ON
END SUB
' ---------------------------------
SUB clearMAX
LOCAL i
for i = 1 to 8
writeMAX i, 0
next i
END SUB
' ---------------------------------
SUB writeMAX(opcode, value)
LOCAL r1, r2
pin(CS) = 0
r1 = spi.byte(opcode)
r2 = spi.byte(value)
verBIN opcode, r1, value, r2
pin(CS) = 1
END SUB
' ---------------------------------
SUB display(char)
LOCAL i, byte
for i = 1 to 8
byte = chars(char, i-1)
writeMAX i, byte
next i
END SUB
' ----------------------------------
SUB initCHARS
LOCAL i, j
for i = 0 to 9
for j = 0 to 7
READ byte
chars(i, j) = byte
next j
next i
END SUB
' -----------------------------------
SUB verBIN(opcode, r1, value, r2)
LOCAL opcode$, value$
opcode$ = bin$(opcode)
opcode$ = string$(8-len(opcode$), "0") + opcode$
value$ = bin$(value)
value$ = string$(8-len(value$), "0") + value$
wlog "Opcode=";opcode$;" r1=";r1,"Value=";value$;" r2=";r2
END SUB
' ==========================================================================================
DATA &b00000000,&b00011000,&b00100100,&b00100100,&b00100100,&b00100100,&b00011000,&b00000000
DATA &b00000000,&b00001000,&b00011000,&b00001000,&b00001000,&b00001000,&b00011100,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00001000,&b00010000,&b00100000,&b00111100,&b00000000
DATA &b00000000,&b00111000,&b00000100,&b00111000,&b00000100,&b00000100,&b00111000,&b00000000
DATA &b00000000,&b00000100,&b00001100,&b00010100,&b00111100,&b00000100,&b00000100,&b00000000
DATA &b00000000,&b00111100,&b00100000,&b00111000,&b00000100,&b00000100,&b00111000,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00100000,&b00111000,&b00100100,&b00011000,&b00000000
DATA &b00000000,&b00111100,&b00000100,&b00001000,&b00010000,&b00100000,&b00100000,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00011000,&b00100100,&b00100100,&b00011000,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00100100,&b00011100,&b00000100,&b00011000,&b00000000
But I don't know what's happening, I can't get it now. I already have entertainment.
The LED activation code (when it works) will be included in the HTML design program, turning on the LEDs in real time as they are activated or deactivated on the screen. And it will allow you to save the created patterns to a file.
I do not propose to create a font editor for maxScroll, but rather an editor of fixed figures that do not scroll (including ASCII characters if necessary), which serve as a template for an independent display system in 8x8 LED matrices, controlled by MAX7219 .
I recovered an old file that I had working a long time ago:
[height=300]
[code=annex]
dim chars(9, 7)
initCHARS
CS = 5 ' CS=GPIO5 - CLK=GPIO18 - DIN=GPIO23
initMAX CS, 0 ' brightness 0 to 10
for h = 0 to 9
display h
pause 1000
next h
clearMAX
END
' ---------------------------------
SUB initMAX(pinCS, brightness)
SPI.SETUP 1000000
SPI.CSPIN CS
writeMAX &H09, 0 ' 6H09 = MAX7219DECODE
writeMAX &H0A, brightness ' &H0A = MAX7219INTENSITY
writeMAX &H0B, 7 ' &H0B = MAX7219SCANLIMIT
writeMAX &H0F, 0 ' &H0F = MAX7219TEST; 0 = TESTMODEOFF
writeMAX &H0C, 1 ' &H0C = MAX7219SHUTDOWN; 1 = MAX7219ON
END SUB
' ---------------------------------
SUB clearMAX
LOCAL i
for i = 1 to 8
writeMAX i, 0
next i
END SUB
' ---------------------------------
SUB writeMAX(opcode, value)
LOCAL r1, r2
pin(CS) = 0
r1 = spi.byte(opcode)
r2 = spi.byte(value)
verBIN opcode, r1, value, r2
pin(CS) = 1
END SUB
' ---------------------------------
SUB display(char)
LOCAL i, byte
for i = 1 to 8
byte = chars(char, i-1)
writeMAX i, byte
next i
END SUB
' ----------------------------------
SUB initCHARS
LOCAL i, j
for i = 0 to 9
for j = 0 to 7
READ byte
chars(i, j) = byte
next j
next i
END SUB
' -----------------------------------
SUB verBIN(opcode, r1, value, r2)
LOCAL opcode$, value$
opcode$ = bin$(opcode)
opcode$ = string$(8-len(opcode$), "0") + opcode$
value$ = bin$(value)
value$ = string$(8-len(value$), "0") + value$
wlog "Opcode=";opcode$;" r1=";r1,"Value=";value$;" r2=";r2
END SUB
' ==========================================================================================
DATA &b00000000,&b00011000,&b00100100,&b00100100,&b00100100,&b00100100,&b00011000,&b00000000
DATA &b00000000,&b00001000,&b00011000,&b00001000,&b00001000,&b00001000,&b00011100,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00001000,&b00010000,&b00100000,&b00111100,&b00000000
DATA &b00000000,&b00111000,&b00000100,&b00111000,&b00000100,&b00000100,&b00111000,&b00000000
DATA &b00000000,&b00000100,&b00001100,&b00010100,&b00111100,&b00000100,&b00000100,&b00000000
DATA &b00000000,&b00111100,&b00100000,&b00111000,&b00000100,&b00000100,&b00111000,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00100000,&b00111000,&b00100100,&b00011000,&b00000000
DATA &b00000000,&b00111100,&b00000100,&b00001000,&b00010000,&b00100000,&b00100000,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00011000,&b00100100,&b00100100,&b00011000,&b00000000
DATA &b00000000,&b00011000,&b00100100,&b00100100,&b00011100,&b00000100,&b00011000,&b00000000
[/code]
[/height]
But I don't know what's happening, I can't get it now. I already have entertainment. :P
The LED activation code (when it works) will be included in the HTML design program, turning on the LEDs in real time as they are activated or deactivated on the screen. And it will allow you to save the created patterns to a file.