Advertisement
KRITSADA

IPST_SE with Thai Text GLCD

Feb 25th, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 18.45 KB | None | 0 0
  1. //#include‬ <ipst.h>
  2.  
  3. const int GLCD_BLACK = 0;
  4. const int GLCD_WHITE = 1;
  5. const int GLCD_YELLOW = 2;
  6.  
  7. unsigned char screen[128][128];
  8.  
  9. void glcdPixel(unsigned int x, unsigned int y, unsigned int color) {
  10.     screen[x][y] = color;
  11. }
  12.  
  13. void glcdFillRect(unsigned int x, unsigned int y, unsigned width, unsigned int height, unsigned int color) {
  14.     for(int i = 0; i < width; i++) {
  15.         for(int j = 0; j < height; j++) {
  16.             glcdPixel(x + i, y + j, color);
  17.         }
  18.     }
  19. }
  20.  
  21. void glcdFillScreen(unsigned int color) {
  22.    
  23. }
  24.  
  25. void setup();
  26. void loop();
  27.  
  28. #include <stdio.h>
  29. #include <string.h>
  30.  
  31. int main() {
  32.     memset(screen, 0, sizeof(screen));
  33.     setup();
  34.     for(int i = 0; i < 128; i++) {
  35.         for(int j = 0; j < 128; j++) {
  36.             putchar(screen[j][i] ? screen[j][i] + '0' : ' ');
  37.         }
  38.         putchar('\n');
  39.     }
  40.     return 0;
  41. }
  42.  
  43. #define THAITEXT_CHAR unsigned char
  44. #define THAITEXT_CHAR_NEWLINE 0xFF
  45. #define THAITEXT_CHAR_ENDLINE THAITEXT_CHAR_NEWLINE
  46. #define THAITEXT_CHAR_WHITESPACE 0xFE
  47. #define THAITEXT_CHAR_COLOR 0xFD
  48. #define THAITEXT_CHAR_LINE_HEIGHT 12
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement