There are no string handling blocks. The only string is a string sprite, but there are no blocks to address the content of the string.
Here is a hack that allows character by character addressing of characters in a string sprite. It can be used to store an arbitrary sequence of characters and take action depending on the next character in sequence.
- Constant (read only) data. You can't address or write to a string sprite
- Slow. Writing to the LED array is quite slow, which could be an issue for any time critical loops
- It has to write the display, so any sequence addressing is visible and destroys other display content
- The programmer has to work out the decoding for the characters used. No one read will decode all possible characters.
- Maximum string length 80 characters
It defines an arbitrary string consisting of UDLR. It steps along this string one character at a time. It decodes the chracter by reading column 3 of the display. You could sample any pixels on the display that discriminate the characters you are using.
In this case U = 15, D = 14, R = 18, L = 16.
To show some result for the demo the corresponding direction word is then scrolled in the specified direction.
Get width of sprite returns the number of characters in the string * 5 (each char is 5*5 pixels).
draw sprite at x position a multiple of 5 displays a single character from the string as if at 0,0.
The column value is binary where b0 is on row 4, b1 row 3 etc.
So U is
So reading col 3 from the top is ****_
As binary, with the top pixel as b0: 01111 = 15 decimal