08 Dot-Matrix Display
08 Dot-Matrix Display
Aufgabe
1. Stellt ein statisches Icon auf dem Dot-Matrix Display dar
Material: Dot-Matrix Display, Patch-Kabel
2. Stellt eine kleine Animation auf dem Dot-Matrix Display dar
Material: Dot-Matrix Display, Patch-Kabel
Code
// LTP-757KR Dot Matrix Display
// Embodied Interaction Basics
// ZHdK, Moritz Kemper
// 11/11/11
#define COLUM_1 12
#define COLUM_2 11
#define COLUM_3 10
#define COLUM_4 9
#define COLUM_5 8
#define ROW_1 7
#define ROW_2 6
#define ROW_3 5
#define ROW_4 4
#define ROW_5 3
#define ROW_6 2
#define ROW_7 1
int colum[5] = {COLUM_1, COLUM_2, COLUM_3, COLUM_4, COLUM_5};
int row[7] = {ROW_1, ROW_2, ROW_3, ROW_4, ROW_5, ROW_6, ROW_7};
int anzeige = 1;
void setup()
{
for(int i = COLUM_1; i>= ROW_7; i--)
{
pinMode(i, OUTPUT);
}
digitalWrite(COLUM_1, HIGH);
digitalWrite(COLUM_2, HIGH);
digitalWrite(COLUM_3, HIGH);
digitalWrite(COLUM_4, HIGH);
digitalWrite(COLUM_5, HIGH);
}
void loop()
{
pulseLED(1, 2);
pulseLED(2, 3);
pulseLED(3, 4);
pulseLED(1, 5);
pulseLED(2, 6);
pulseLED(3, 7);
}
void pulseLED(int whichColum, int whichRow)
{
digitalWrite(colum[whichColum-1], LOW);
digitalWrite(row[whichRow-1], HIGH);
delayMicroseconds(100);
digitalWrite(colum[whichColum-1], HIGH);
digitalWrite(row[whichRow-1], LOW);
}
Links: