Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (fetched == true) {
- for(char j = 1; j <= 4; ++j) {
- // Select board 1 as the target of subsequent drawing/rendering operations.
- HT1632.drawTarget(BUFFER_BOARD(j));
- HT1632.clear();
- HT1632.drawText(buffer[buffer_to_render_first], (5-j)*OUT_SIZE - i, 0,
- FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
- HT1632.drawText(buffer[1-buffer_to_render_first], (5-j)*OUT_SIZE-i+wd[buffer_to_render_first], 0,
- FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
- HT1632.render(); // Board j's contents is updated.
- }
- }
- if(i>=wd[buffer_to_render_first] + OUT_SIZE * 4) {
- // This is true when one of the elements has scrolled entirely off the first screen
- /* TODO: Download and overwrite buffer[buffer_to_render_first] with a new headline from your server. */
- wd[buffer_to_render_first] = HT1632.getTextWidth(buffer[buffer_to_render_first],
- FONT_5X4_WIDTH, FONT_5X4_HEIGHT);
- if(wd[buffer_to_render_first]<OUT_SIZE*4)wd[buffer_to_render_first]=OUT_SIZE*4;
- buffer_to_render_first = 1 - buffer_to_render_first; // Change the currently first-rendering buffer.
- } else
- ++i; // Shift the text before the next render.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement