PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5KB

  1. // UTFT_Bitmap (C)2012 Henning Karlsen
  2. // web: http://www.henningkarlsen.com/electronics
  3. //
  4. // This program is a demo of the drawBitmap()-function.
  5. //
  6. // This demo was made to work on the 320x240 modules.
  7. // Any other size displays may cause strange behaviour.
  8. //
  9. // This program requires the UTFT library.
  10. //
  11. #include <UTFT.h>
  12. // Declare which fonts we will be using
  13. extern uint8_t SmallFont[];
  14. // Uncomment the next line for chipKit Uno32/uC32
  15. UTFT myGLCD(ITDB24D,34,35,36,37); // Remember to change the model parameter to suit your display module!
  16. // Uncomment the next line for chipKit Max32
  17. //UTFT myGLCD(ITDB24D,82,83,84,85); // Remember to change the model parameter to suit your display module!
  18. extern unsigned short info[0x400];
  19. extern unsigned short icon[0x400];
  20. extern unsigned short tux[0x400];
  21. void setup()
  22. {
  23. myGLCD.InitLCD();
  24. myGLCD.setFont(SmallFont);
  25. }
  26. void loop()
  27. {
  28. myGLCD.fillScr(255, 255, 255);
  29. myGLCD.setColor(255, 255, 255);
  30. myGLCD.print(" *** A 10 by 7 grid of a 32x32 icon *** ", CENTER, 228);
  31. for (int x=0; x<10; x++)
  32. for (int y=0; y<7; y++)
  33. myGLCD.drawBitmap (x*32, y*32, 32, 32, info);
  34. delay(5000);
  35. myGLCD.fillScr(255, 255, 255);
  36. myGLCD.setColor(255, 255, 255);
  37. myGLCD.print(" Two different icons in scale 1 to 4 ", CENTER, 228);
  38. int x=0;
  39. for (int s=0; s<4; s++)
  40. {
  41. x+=(s*32);
  42. myGLCD.drawBitmap (x, 0, 32, 32, tux, s+1);
  43. }
  44. x=0;
  45. for (int s=4; s>0; s--)
  46. {
  47. myGLCD.drawBitmap (x, 224-(s*32), 32, 32, icon, s);
  48. x+=(s*32);
  49. }
  50. delay(5000);
  51. }