Advertisement
gauravmm

Media Circus - HT1632 [0]

Feb 13th, 2012
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.28 KB | None | 0 0
  1.  
  2.   if (fetched == true) {
  3.     for(char j = 1; j <= 4; ++j) {
  4.         // Select board 1 as the target of subsequent drawing/rendering operations.
  5.         HT1632.drawTarget(BUFFER_BOARD(j));
  6.         HT1632.clear();
  7.         HT1632.drawText(buffer[buffer_to_render_first], (5-j)*OUT_SIZE - i, 0,
  8.         FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
  9.         HT1632.drawText(buffer[1-buffer_to_render_first], (5-j)*OUT_SIZE-i+wd[buffer_to_render_first], 0,
  10.         FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
  11.  
  12.         HT1632.render(); // Board j's contents is updated.
  13.     }
  14.   }
  15.  
  16.   if(i>=wd[buffer_to_render_first] + OUT_SIZE * 4) {
  17.   // This is true when one of the elements has scrolled entirely off the first screen
  18.      /* TODO: Download and overwrite buffer[buffer_to_render_first] with a new headline from your server. */
  19.       wd[buffer_to_render_first] = HT1632.getTextWidth(buffer[buffer_to_render_first],
  20.                                          FONT_5X4_WIDTH, FONT_5X4_HEIGHT);
  21.       if(wd[buffer_to_render_first]<OUT_SIZE*4)wd[buffer_to_render_first]=OUT_SIZE*4;
  22.       buffer_to_render_first = 1 - buffer_to_render_first; // Change the currently first-rendering buffer.
  23.   } else
  24.     ++i; // Shift the text before the next render.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement