Go Down

Topic: matrice 8x8 sensore dht22 (Read 2 times) previous topic - next topic

nid69ita

my name is IGOR, not AIGOR

Mawer

OK ultimo help  ;).
posto parte di sketch
Code: [Select]

// array row numero pin:
const int rownum[8] = {
2,7,19,5,13,18,12,16};
//array column numero pin:
const int colnum[8] = {
6,11,10,3,17,4,8,9};

float timeCount = 0;

int h[8][8] = {
{0,0,1,1,0,1,1,1},
{0,0,1,0,1,0,1,0},
{0,0,1,0,0,0,1,0},
{1,1,1,1,1,1,1,0},
{0,0,1,1,1,1,1,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0}};

int e[8][8] = {
{0,0,1,1,1,1,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,1,1,1,0},
{0,0,0,0,1,1,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,1,1,1,1,1,0}};

int l[8][8] = {
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,0,0,0,0,1,0},
{0,0,1,1,1,1,1,0}};

int o[8][8] = {
{0,0,0,1,1,1,0,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,0,1,1,1,0,0}};

int smile[8][8] = {
{0,0,0,0,0,0,0,0},
{0,1,1,0,0,1,1,0},
{0,1,1,0,0,1,1,0},
{0,1,1,0,0,1,1,0},
{0,0,0,0,0,0,0,0},
{0,1,0,0,0,0,1,0},
{0,0,1,0,0,1,0,0},
{0,0,0,1,1,0,0,0}};

int blank[8][8] = {
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0}};

void setup() {
//Serial.begin(9600);
// initialize the I/O pins as outputs:

// iterate over the pins:
for (int thisPin = 0; thisPin < 8; thisPin++) {
// initialize the output pins:
pinMode(colnum[thisPin], OUTPUT);
pinMode(rownum[thisPin], OUTPUT);
// take the col pins (i.e. the cathodes) high to ensure that
// the LEDS are off:
digitalWrite(colnum[thisPin], LOW);
digitalWrite(rownum[thisPin], HIGH);
}

}

void loop() {}


come faccio per stampare sulla matrice la lettera "h" ? :smiley-eek:  drawScreen(h); ?

uwefed


Se vuoi usare meno pin per collegare la matrice 8x8 devi usare degli integrati shift register
http://www.cooking-hacks.com/index.php/blog/tutorial-arduino-led-matrix-74ch595
http://www.insidegadgets.com/2010/11/07/fun-with-8x8-led-matrix/

Se vuoi usare meno piedini e non vuoi far fare il multiplexing al Arduino usa un MAX7219.

Ciao Uwe

Mawer

Ma posso utilizzarlo anche così ?

Brunello

il MAX7219 e' specifico per collegare una matrice di 8x8 Led.

Lo sketch che hai non va' bene, ma ci sono librerie apposite che semplificano la vita

ad esmpio la Ledcontrol  http://www.wayoda.org/arduino/ledcontrol/index.html

Go Up