Changes

Jump to: navigation, search

Week Z

250 bytes added, 16:32, 26 May 2009
no edit summary
Multiplexed Displays
 
from [[Electronic Technologies for Art]]
 
== Dot Matrix ==
=== Circuit ===
int clockPin = 8; // CP input (pin 14) on 4017 decade counter.
int resetPin = 9; // MR (pin 15) on 4017.
 
void setup() // run once, when the sketch starts
{
pinMode(resetPin, OUTPUT);
// set row pins to be outputs
for(int j=0;j<7;j++)
pinMode(j, OUTPUT);
}
void loop() // run over and over again
{
for (int icol=0; icol<5; icol++)
{
for(int jrow=0;jrow<7;jrow++) digitalWrite(jrow, img[i+j*5]HIGH);
delay(1);
// send the next clock pulse // (to move the decade counter digitalWrite(clockPin, HIGH); // sets the LED on digitalWrite(clockPin, LOW); // sets the LED off
};
// reset the counter to the first column
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
}
 
 
</pre>
0, 0, 0, 0, 0,
1, 0, 0, 0, 1,
0, 1, 01, 01, 0, 1, 0, 10, 10, 10, 0 };
void setup() // run once, when the sketch starts
pinMode(resetPin, OUTPUT);
// set row pins to be outputs
for(int j=0;j<7;j++)
pinMode(j, OUTPUT);
}
void loop() // run over and over again
{
for (int icol=0; icol<5; icol++)
{
for(int jrow=0;jrow<7;jrow++) digitalWrite(jrow, img[icol+jrow*5]);
delay(1);
// send the next clock pulse // (to move the decade counter digitalWrite(clockPin, HIGH); // sets the LED on digitalWrite(clockPin, LOW); // sets the LED off
};
// reset the counter to the first column
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
}
 
</pre>
=== See Also ===
Examples -> Library-Matrix

Navigation menu