浏览代码

Text orientation sample code fixes #11

James Bowman 6 年之前
父节点
当前提交
01f4fe274a
共有 1 个文件被更改,包括 36 次插入0 次删除
  1. 36 0
      tut-bitmaps.ino

+ 36 - 0
tut-bitmaps.ino

@@ -0,0 +1,36 @@
+#include <EEPROM.h>
+#include <SPI.h>
+#include <GD2.h>
+
+
+Bitmap hello;
+Bitmap world;
+
+void setup()
+{
+  GD.begin();
+
+  hello.fromtext(31, "hello");
+  world.fromtext(31, "world");
+}
+
+int angle = DEGREES(0);
+
+void loop()
+{
+
+  GD.Clear();
+
+  int x = GD.w / 2;
+  int y = GD.h / 2;
+
+  GD.ColorRGB(0x008080);
+  hello.draw(x, y, angle);
+
+  GD.ColorRGB(0xffa500);
+  world.draw(x, y, -angle);
+
+  angle += DEGREES(1);
+
+  GD.swap();
+}