Kinda cool 72x6 LED matrix no one cares about
Command syntax is made as compact as possible
Example: CMD<ahello<b123/
CMD
– command name. Command names always consist of three uppercase characters<a
– first argument key. All argument keys begin with<
and consist of only one lowercase characterhello
– first argument value<b
– second argument key123
– second argument value/
– slash is required at the end of the command
Reserved symbols:
<
/
Reserved argument keys:
d
(argument derived from another piece of hardware code)
Reserved keywords:
%IS%
(value exists)%NONE%
(value doesn't exist)%SCR%
(scrolling animation)%BLI%
(blinking animation)%RND%
(random color)%CHRND%
(random color of every character)%TLL%
(taillight coloring)
Command arguments values represent different data types. This is the reference
- Int – number:
123
- String – case insensitive piece of text excluding reserved keywords and keys:
hello world
- Char – case insensitive character:
F
- ExBool – gets intepreted as
true
if argument is present in the command. - Color – rgb representation of the color:
Int,Int,Int
/ random color:%RND%
/ char random coloring:%CHRND%
/ tailight coloring:%TLL%
- Animation – scrolling:
%SCR%
/ blinking:%BLI%
- Time – time in H,M,S,D,M,Y format:
Int,Int,Int,Int,Int,Int
- CCPS – covey's compressed pixel sequence string:
C>3RRGBWA>6
- Error – error code string
Required arguments:
t
: String – text to displayc
: Color – color of the text
Optional arguments:
i
: ExBool – whether to display inout animationa
: Animation – animation to applye
: Int – animation counter delay (1-10)
Optional return:
- Error
ER011
/ER012
/ER021
Required arguments:
h
: Char – char to appendc
: Color – color of the matrix
Optional return:
- Error
ER011
/ER012
/ER021
/ER041
CPS – draw CCPS
Required arguments:
s
: CCPS – sequence to draw
Optional return:
- Error
ER011
/ER012
/ER021
/ER051
/ER052
Required arguments:
t
: Time – time to sync
Optional return:
- Error
ER011
/ER012
/ER021
Required arguments:
v
: Int – value (4-255)
Optional return:
- Error
ER011
/ER012
/ER021
Guaranteed return:
- String – constant
pong
message
Covey's Compressed Pixel Sequence – the most compact way of filling the matrix I could work out
PSs get drawn on a pixel-by-pixel basis. So, to draw something, an ordered list of instructions must be set to the device.
Each instruction is either a Custom Color
, Default Color
or Set
.
Every Int
must have a trailing comma if followed by another Int
Custom Color is a set of R, G and B values.
Each value is either an Int
, an f
key, which represents full value (255), or an e
key, which represents empty value (0).
Examples:
139ef
– violet-colored pixel (gets interpreted as 139, 0, 255)f165e
– orange-colored pixel (gets interpreted as 255, 165, 0)
Default Color is one of the default presets, presented as a Key
.
Keys:
W
(white) –255, 255, 255
pixelN
(none) –0, 0, 0
pixelA
(alpha) – skip this pixel. If anything was previously displayed on the matrix, it won't be overlappedR
(red) –255, 0, 0
pixelG
(green) –0, 255, 0
pixelB
(blue) –0, 0, 255
pixelC
(cyan) –0, 255, 255
pixelM
(magenta) –255, 0, 255
pixelY
(yellow) –255, 255, 0
pixel
Set is a repeated instruction.
Each set consists of either a Custom Color
or Default Color
instruction followed by <
key, and either an Int
, representing the number of repeats, or an i
key, which leads to drawing an instruction until the end of matrix.
Any instruction after >i
gets ignored.
Examples:
139ef>120
– violet-colored pixel, drawn 120 timesf165e>i
– orange-colored pixel, drawn until the end of matrixR>9
– red-colored pixel, drawn 9 times
NB: Sets don't make sence when a
Default Color
instruction should be drawn less than 4 times, as their definition in this case takes 3 characters.
WWRBB
– draw two white, one red and two blue pixelsNNf165,e
– draw two black pixels, followed by an orange oneR>100AAG>50
– draw 100 red pixels, skip two and draw 50 green pixelsf192,203>100N>i
– draw 100 pink pixels, draw the remaining in blackR>72,f100e>72Y>72G>72B>72,139ef>72
– draw LGBT flag (change 72 to number of pixels in a row)
Error codes are returned by some functions if they fail to properly execute. Here's the reference
ER011
– unexpected '1' selector while parsing command argumentsER012
– unexpected '2' selector while parsing command argumentsER021
– required argument not servedER031
– unknown commandER032
– unknown routineER033
– unknown CCPS instructionER041
– type error: expected CharER051
– corrupted CCPS: unexpectedi
ER052
– corrupted CCPS: unexpected<