tut-bitmaps.ino 422 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <EEPROM.h>
  2. #include <SPI.h>
  3. #include <GD2.h>
  4. Bitmap hello;
  5. Bitmap world;
  6. void setup()
  7. {
  8. GD.begin();
  9. hello.fromtext(31, "hello");
  10. world.fromtext(31, "world");
  11. }
  12. int angle = DEGREES(0);
  13. void loop()
  14. {
  15. GD.Clear();
  16. int x = GD.w / 2;
  17. int y = GD.h / 2;
  18. GD.ColorRGB(0x008080);
  19. hello.draw(x, y, angle);
  20. GD.ColorRGB(0xffa500);
  21. world.draw(x, y, -angle);
  22. angle += DEGREES(1);
  23. GD.swap();
  24. }