Skip to content

Instantly share code, notes, and snippets.

@y-yu
Created February 29, 2012 00:25
Show Gist options
  • Save y-yu/1936484 to your computer and use it in GitHub Desktop.
Save y-yu/1936484 to your computer and use it in GitHub Desktop.
まとりっくす3
#include <Sprite.h>
#include <Matrix.h>
#include <TimerOne.h>
Matrix mtx = Martix(10, 12, 11);
Sprite tsuku = Sprite(
8, 7,
B01001000,
B01101110,
B10110100,
B00000000,
B11101100,
B01001100,
B11110110
);
Sprite ba = Sprite(
8, 7,
B10001000,
B00111110,
B10101010,
B00111100,
B10110100,
B10101000,
B11010110
);
int x = 0;
void setup() {
Timer1.initialize();
Timer1.attachInterrupt(set_speed, 500000);
}
void loop() {
mtx.write(0-x, 0, tsuku);
mtx.write(8-x, 0, ba);
mtx.write(16-x, 0, tsuku);
delay(100);
}
void set_speed() {
sens = analogRead(0);
x = sens % 16;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment