Skip to content

Instantly share code, notes, and snippets.

@ssov
Created February 22, 2012 01:14
Show Gist options
  • Save ssov/1880383 to your computer and use it in GitHub Desktop.
Save ssov/1880383 to your computer and use it in GitHub Desktop.
ねむい〄
#include <Sprite.h>
#include <Matrix.h>
Matrix mtx = Matrix(3, 5, 4);
Sprite I = Sprite( // スプライト 1 文字目
8, 7,
B00111100,
B00011000,
B00011000,
B00011000,
B00011000,
B00011000,
B00111100);
Sprite T = Sprite( // スプライト 2 文字目
8, 7,
B01111110,
B01111110,
B00011000,
B00011000,
B00011000,
B00011000,
B00011000);
Sprite F = Sprite( // スプライト 3 文字目
8, 7,
B01111110,
B01111110,
B01100000,
B01111000,
B01111000,
B01100000,
B01100000);
void setup() { }
int x = 0;
void loop() {
mtx.write(0 - x, 0, I); // スプライトの書き込み
mtx.write(8 - x, 0, T);
mtx.write(16 - x, 0, F);
mtx.write(24 - x, 0, I);
delay(100);
mtx.clear(); // 画面のクリア
if (x == 24) x = 0;
x++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment