
Instruction
A brand new way to play with 8*8 matrix! Put your board aside after uploading. This small matrix has a quicker & easier way of displaying what you want. Tiny, portable, with microcontroller, display & power supply included, making it more convenienient to play with. You can programme whatever you want to display according to the sample codes in Wiki page.For example, a beating heart, a smile face, or even a slot machine. It can be a gift to your girlfriend, children, the choice is up to you. No need to connect other jumper cables & microcontroller. Find this cool little blittering dice in the bar, in a party... Now it's your turn to give it a new life.
Specification
- MCU: Atmega8
- Led color: red
- Programmable hang decorations
- Charging circuit build in
- Lipo battery x1
- Xbee socket x1
- 8*8 matrix module x1
- Size: 32x32mm
Sample Code
Library for sample code
- Put the <led_8x8.h>in the same file of the sample codes
#include <Arduino.h>
const uint8_t row[8] = {9, 8, 4, 17, 3, 10, 11, 6};
const uint8_t col[8] = {2, 7, 19, 5, 13, 18, 12, 16};
void led_init (void) {
for (int pin = 0; pin<8; pin++) {
pinMode (row[pin], OUTPUT);
pinMode (col[pin], OUTPUT);
digitalWrite (row[pin], LOW);
digitalWrite (col[pin], HIGH);
}
}
void led_xy_on (int x, int y) {
digitalWrite (row[x], HIGH);
digitalWrite (col[y], LOW);
digitalWrite (col[y], HIGH);
digitalWrite (row[x], LOW);
}
void led_xy_time (int x, int y, int time) {
for (int t=0; t<=time; t++) {
digitalWrite (row[x], HIGH);
digitalWrite (col[y], LOW);
digitalWrite (col[y], HIGH);
digitalWrite (row[x], LOW);
}
}
void led_xy_state (int x, int y, int state) {
digitalWrite (row[x], HIGH);
digitalWrite (col[y], !state);
digitalWrite (col[y], HIGH);
digitalWrite (row[x], LOW);
}
void led_pic (int pix[8][8]) {
for (int x=0; x<8; x++)
for (int y=0; y<8; y++)
led_xy_state (x, y, pix[x][y]);
}
void led_pix (int pix[][8][8], int pmax, int time) {
for (int p=0; p<pmax; p++)
for (int t=0; t<time; t++)
for (int x=0; x<8; x++)
for (int y=0; y<8; y++)
led_xy_state (x, y, pix[p][x][y]);
}
void led_all_on () {
for (int i=0; i<8; i++) {
digitalWrite (row[i], HIGH);
digitalWrite (col[i], LOW);
}
}
Sample code
More Documents