TFT display code #26

Closed
opened 2018-11-18 12:28:47 +00:00 by Riolaurenti · 2 comments
Riolaurenti commented 2018-11-18 12:28:47 +00:00 (Migrated from github.com)

021/TFT code currently counts the amount of messages received using a primitive counter.

When the counter is full, it draws a black box over the first half of the screen, and resets the cursor position to the top.
The second time the counter fills, it draws a black box over the second half of the screen and resets cursor position to half way.

This is a crude way to see a "history" whilst re-writing over the pixels used.

  • counter is crap, use length of received string to determine point of reset
  • store last message and recolour grey when new message arrives
  • display separate area of refresh for Sensor information
  • dynamic drawing of black boxes, smaller and faster.
021/TFT code currently counts the amount of messages received using a primitive counter. When the counter is full, it draws a black box over the first half of the screen, and resets the cursor position to the top. The second time the counter fills, it draws a black box over the second half of the screen and resets cursor position to half way. This is a crude way to see a "history" whilst re-writing over the pixels used. - [x] counter is crap, use length of received string to determine point of reset - [x] store last message and recolour grey when new message arrives - [x] display separate area of refresh for Sensor information - [x] dynamic drawing of black boxes, smaller and faster.
Squatnet commented 2018-11-22 00:28:10 +00:00 (Migrated from github.com)

isnt there a way to take a copy of a number of pixels and then draw that copy over another area? i think maybe something like when we get to the last line we copy everything but the first line, and paste it over where the first line would be... maybe give the appearance of scrolling.
something to do with READGRAM()
check this code from MCUFRIEND / graphicstest.ino

void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf)
{
    if (dx) for (int16_t row = 0; row < ht; row++) {
            READGRAM(x, y + row, buf, wid, 1);
            tft.setAddrWindow(x, y + row, x + wid - 1, y + row);
            tft.pushColors(buf + dx, wid - dx, 1);
            tft.pushColors(buf + 0, dx, 0);
        }
    if (dy) for (int16_t col = 0; col < wid; col++) {
            READGRAM(x + col, y, buf, 1, ht);
            tft.setAddrWindow(x + col, y, x + col, y + ht - 1);
            tft.pushColors(buf + dy, ht - dy, 1);
            tft.pushColors(buf + 0, dy, 0);
        }
}
isnt there a way to take a copy of a number of pixels and then draw that copy over another area? i think maybe something like when we get to the last line we copy everything but the first line, and paste it over where the first line would be... maybe give the appearance of scrolling. something to do with `READGRAM()` check this code from MCUFRIEND / graphicstest.ino ``` void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf) { if (dx) for (int16_t row = 0; row < ht; row++) { READGRAM(x, y + row, buf, wid, 1); tft.setAddrWindow(x, y + row, x + wid - 1, y + row); tft.pushColors(buf + dx, wid - dx, 1); tft.pushColors(buf + 0, dx, 0); } if (dy) for (int16_t col = 0; col < wid; col++) { READGRAM(x + col, y, buf, 1, ht); tft.setAddrWindow(x + col, y, x + col, y + ht - 1); tft.pushColors(buf + dy, ht - dy, 1); tft.pushColors(buf + 0, dy, 0); } } ```
Riolaurenti commented 2018-11-22 17:12:51 +00:00 (Migrated from github.com)

yes, thinking about it it is in the example code we first run (deadbeef)

I'll toy around with it this evening, see what can be done.

On Thu, Nov 22, 2018 at 12:28 AM Squatnet notifications@github.com wrote:

isnt there a way to take a copy of a number of pixels and then draw that
copy over another area? i think maybe something like when we get to the
last line we copy everything but the first line, and paste it over where
the first line would be... maybe give the appearance of scrolling.
something to do with readGRAM()
check this code from MCUFRIEND / graphicstest.ino

void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf)
{
if (dx) for (int16_t row = 0; row < ht; row++) {
READGRAM(x, y + row, buf, wid, 1);
tft.setAddrWindow(x, y + row, x + wid - 1, y + row);
tft.pushColors(buf + dx, wid - dx, 1);
tft.pushColors(buf + 0, dx, 0);
}
if (dy) for (int16_t col = 0; col < wid; col++) {
READGRAM(x + col, y, buf, 1, ht);
tft.setAddrWindow(x + col, y, x + col, y + ht - 1);
tft.pushColors(buf + dy, ht - dy, 1);
tft.pushColors(buf + 0, dy, 0);
}
}


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Squatnet/ArduinoStuff/issues/26#issuecomment-440863434,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AV5Oq_U3w9Zo6839F_Bl60AzVep_OK-gks5uxe-agaJpZM4Yn6qi
.

yes, thinking about it it is in the example code we first run (deadbeef) I'll toy around with it this evening, see what can be done. On Thu, Nov 22, 2018 at 12:28 AM Squatnet <notifications@github.com> wrote: > isnt there a way to take a copy of a number of pixels and then draw that > copy over another area? i think maybe something like when we get to the > last line we copy everything but the first line, and paste it over where > the first line would be... maybe give the appearance of scrolling. > something to do with readGRAM() > check this code from MCUFRIEND / graphicstest.ino > > void windowScroll(int16_t x, int16_t y, int16_t wid, int16_t ht, int16_t dx, int16_t dy, uint16_t *buf) > { > if (dx) for (int16_t row = 0; row < ht; row++) { > READGRAM(x, y + row, buf, wid, 1); > tft.setAddrWindow(x, y + row, x + wid - 1, y + row); > tft.pushColors(buf + dx, wid - dx, 1); > tft.pushColors(buf + 0, dx, 0); > } > if (dy) for (int16_t col = 0; col < wid; col++) { > READGRAM(x + col, y, buf, 1, ht); > tft.setAddrWindow(x + col, y, x + col, y + ht - 1); > tft.pushColors(buf + dy, ht - dy, 1); > tft.pushColors(buf + 0, dy, 0); > } > } > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/Squatnet/ArduinoStuff/issues/26#issuecomment-440863434>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AV5Oq_U3w9Zo6839F_Bl60AzVep_OK-gks5uxe-agaJpZM4Yn6qi> > . >
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
squatnet/ArduinoStuff#26
No description provided.