TM1640 Matrix + ArrayBuffer first column of letter does not appear in scrolling text #4886
Replies: 1 comment
-
Posted at 2020-05-17 by Mrbbp I tried with a larger arrayBuffer same problem! Posted at 2020-05-17 by @allObjects Yes, drawing text at or straddling the border has their fare share of challenges. If it worked before I could attribute the not working anymore to somer performance (and space) increasing changes within Espruino - if their were actually changes (rendering test algorithm). I like the approach of choosing a larger buffer.... but I would not directly write out of that buffer w/ flip and then redraw at a new position. Since it is monochrome you have plenty of memory. Write to an even larger buffer - one that hold ALL your text, and then move the view port (view) over the buffer for display... then you do not have the issue with jerky render text into the buffer. You deal only w/ transferring frame by frame to the display. Since it is one byte per column, you can easily increment thru the buffer with the view: first bytes 0..7, then 1..8, then 2..9, etc. If you have changing text you can even rolling changing it... Define a just one (long) line. Update the line accordingly (by shift and write new text and have the transfer to the display shift its line start in the buffer as well. Posted at 2020-05-17 by Mrbbp Hello @allObjects, I think I understood the idea of a large ArrayBuffer with the entire line of text and display only part of it. Unfortunately, I am not comfortable with ArrayBuffers nor dataView I read on MDN that there was an arrayBuffer.slice (start, end) but on espruino, the function does not return an arrayBuffer but just an array so I remain skeptical about the solution. the basic writing program
a try as you said
Am i on the good way? regards Posted at 2020-05-17 by @MaBecker Don’t miss to check http://www.espruino.com/Reference#l_Graphics_scroll Posted at 2020-05-17 by @MaBecker this is how it was possible before having g.scroll https://gist.github.com/MaBecker/b7a7bf082274b69c53a8b92b5d7b85e4 Posted at 2020-05-17 by Mrbbp @MaBecker :) thanks Posted at 2020-05-18 by @gfwilliams
This could be possible - there is some code now which tries to clip offscreen chars to improve rendering speed. Do you have a really simple example where this fails? For example if you run this code in the IDE:
You should see |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-05-17 by Mrbbp
Sorry long title...
I'm working with Chrome app (cause i've got custom font) with last firmware (2.05) on Pico board.
I discovered a strange behavior (not seen before)
I'm scrolling a text on a 8x8 led matrix with a TM1640 driver (a wemos matrix shield, chip and easy to drive)
I reuse an early script ( that was working, and working with this driver, not the first time i use it), this time i found the scroll jerky, so i slowed down the scroll and i identified what i was feeling...
the first column of a char is never seen, the buffer (i suppose) saw only the char with 2 column and more (not only one).
There is no missing column on the buffer, i have 8 column lighted
it happens on every letter (even if I delete my custom font) appearing from the right side.
It looks like the
drawString
does not draw the char if it is on the boarder...in my code i use a
setRotation()
, i' tried without it, same pb.any help?
i give my durty code to test
best regards
éric
Beta Was this translation helpful? Give feedback.
All reactions