LED Matrix TYWu Schematic 64 LEDs Ark SZ

  • Slides: 26
Download presentation
LED Matrix TYWu

LED Matrix TYWu

Schematic • 64 LEDs Ark SZ 410788 K

Schematic • 64 LEDs Ark SZ 410788 K

Operation • Example 1 1 0 0 Ark SZ 410788 K

Operation • Example 1 1 0 0 Ark SZ 410788 K

Operation • How to Control?

Operation • How to Control?

Operation • Time Sharing Δ Δ

Operation • Time Sharing Δ Δ

Pin Connections • pins[ ] pins[9] pins[16] pins[8] pins[1]

Pin Connections • pins[ ] pins[9] pins[16] pins[8] pins[1]

Pin Connections • Pin Connections pins[9] pins[16] COL 8 COL 4 COL 1 ROW

Pin Connections • Pin Connections pins[9] pins[16] COL 8 COL 4 COL 1 ROW 8 ROW 1 pins[8] pins[1]

Pin Connections • Pin Connections

Pin Connections • Pin Connections

Pin Connections • Pin Connections pins: 5 2 7 1 12 8 14 9

Pin Connections • Pin Connections pins: 5 2 7 1 12 8 14 9 pins: 13 3 4 10 6 11 15 16

Pin Connections • Source Data (Back Side) pins[9] pins[8] pins[16] pins[1]

Pin Connections • Source Data (Back Side) pins[9] pins[8] pins[16] pins[1]

Connection for Arduino • 16 Wires Ark SZ 410788 K

Connection for Arduino • 16 Wires Ark SZ 410788 K

Connection for Arduino • 16 Wires – int pins[17]= {-1, 5, 4, 3, 2,

Connection for Arduino • 16 Wires – int pins[17]= {-1, 5, 4, 3, 2, 14, 15, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6}; • cols and rows – int cols[8] = {pins[5], pins[2], pins[7], pins[12], pins[8], pins[14], pins[9]}; – int rows[8] = {pins[13], pins[4], pins[10], pins[6], pins[11], pins[15], pins[16]};

Sketch • Demonstration O H E L

Sketch • Demonstration O H E L

Sketch • Nonscrolled_Matrix_LED. pde #define SPACE {  {0, 0, 0, 0, 0, 0,

Sketch • Nonscrolled_Matrix_LED. pde #define SPACE { {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }

Sketch #define H {  {0, 1, 0, 0, 1, 0},  {0, 1,

Sketch #define H { {0, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 1, 0}, {0, 1, 1, 1, 0}, {0, 1, 0, 0, 0, 0, 1, 0} }

Sketch : #define O {  {0, 0, 0, 1, 1, 0, 0, 0},

Sketch : #define O { {0, 0, 0, 1, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 0, 0, 0, 0, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 1, 0, 0, 0} }

Sketch byte col = 0; byte leds[8][8]; // pin[xx] on led matrix connected to

Sketch byte col = 0; byte leds[8][8]; // pin[xx] on led matrix connected to nn on Arduino (-1 is dummy to make array start at pos 1) int pins[17]= {-1, 5, 4, 3, 2, 14, 15, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6}; int cols[8] = {pins[5], pins[2], pins[7], pins[12], pins[8], pins[14], pins[9]}; int rows[8] = {pins[13], pins[4], pins[10], pins[6], pins[11], pins[15], pins[16]}; const int num. Patterns = 6;

Sketch byte patterns[num. Patterns][8][8] = { H, E, L, L, O, SPACE }; int

Sketch byte patterns[num. Patterns][8][8] = { H, E, L, L, O, SPACE }; int pattern = 0; void setup() { // sets the pins as output for (int i = 1; i <= 16; i++) { pin. Mode(pins[i], OUTPUT); }

Sketch for (int i = 1; i <= 8; i++) { digital. Write(cols[i -

Sketch for (int i = 1; i <= 8; i++) { digital. Write(cols[i - 1], LOW); } for (int i = 1; i <= 8; i++) { digital. Write(rows[i - 1], LOW); } clear. Leds(); set. Pattern(pattern); }

Sketch void loop() { int showperiod = 50; pattern = ++pattern % num. Patterns;

Sketch void loop() { int showperiod = 50; pattern = ++pattern % num. Patterns; slide. Pattern(pattern, 1); for (int i = 1; i <= 8 * showperiod; i++) { display(); delay(1); // For light up each light LED } }

Sketch void clear. Leds() { // Clear display array for (int i = 0;

Sketch void clear. Leds() { // Clear display array for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { leds[i][j] = 0; } } }

Sketch void set. Pattern(int pattern) { for (int i = 0; i < 8;

Sketch void set. Pattern(int pattern) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { leds[i][j] = patterns[pattern][i][j]; } } }

Sketch void slide. Pattern(int pattern, int del) { for (int l = 0; l

Sketch void slide. Pattern(int pattern, int del) { for (int l = 0; l < 8; l++) { Before Execution for (int i = 0; i < 7; i++) { for (int j = 0; j < 8; j++) { leds[j][i] = leds[j][i+1]; // Dull Approach leds } } for (int j = 0; j < 8; j++) { leds[j][7] = patterns[pattern][j][0 + l]; } delay(del); After Execution } } H

Sketch void display() { digital. Write(cols[col], LOW); // Turn whole previous column off col++;

Sketch void display() { digital. Write(cols[col], LOW); // Turn whole previous column off col++; if (col == 8) {col = 0; } for (int row = 0; row < 8; row++) { if (leds[row][col] == 1) { digital. Write(rows[row], LOW); // Turn on this led } else { digital. Write(rows[row], HIGH); // Turn off this led } } digital. Write(cols[col], HIGH); // Turn whole column on at once (for equal lighting times) }

C • Initialization: – #define NUMROWS 3 – #define NUMCOLS 4 – int val[NUMROWS][NUMCOLS]

C • Initialization: – #define NUMROWS 3 – #define NUMCOLS 4 – int val[NUMROWS][NUMCOLS] = { {8, 16, 9, 52}, – {3, 15, 27, 6}, – {14, 25, 2, 10} }; • The inner braces can be omitted: – int val[NUMROWS][NUMCOLS] = {8, 16, 9, 52, 3, 15, 27, 6, 14, 25, 2, 10}; • Initialization is done in row order

C Y X

C Y X