So, you read the title, of course this is gonna be a n00b question thread so:
Ive seen this video about an 8x8 LED Matrix:
the guy's using some of the pins as ground, and can activate if its open or closed via code.
My problem understanding this is, all of the pins are set to output, and he seems to turn them high to use them as ground? heres the code:
void drawScreen(byte buffer2[]){
// Turn on each row in series
for (byte i = 0; i < 8; i++) {
setColumns(buffer2*); // Set columns for this specific row*_ digitalWrite(rows*, HIGH);_
_ delay(2); // Set this to 50 or 100 if you want to see the multiplexing effect!_
_ digitalWrite(rows, LOW);*_* }*
}
void setColumns(byte b) {
* digitalWrite(COL_1, (~b >> 0) & 0x01); // Get the 1st bit: 10000000*
* digitalWrite(COL_2, (~b >> 1) & 0x01); // Get the 2nd bit: 01000000*
* digitalWrite(COL_3, (~b >> 2) & 0x01); // Get the 3rd bit: 00100000*
* digitalWrite(COL_4, (~b >> 3) & 0x01); // Get the 4th bit: 00010000*
* digitalWrite(COL_5, (~b >> 4) & 0x01); // Get the 5th bit: 00001000*
* digitalWrite(COL_6, (~b >> 5) & 0x01); // Get the 6th bit: 00000100*
* digitalWrite(COL_7, (~b >> 6) & 0x01); // Get the 7th bit: 00000010*
* digitalWrite(COL_8, (~b >> 7) & 0x01); // Get the 8th bit: 00000001** // If the polarity of your matrix is the opposite of mine*
* // remove all the '~' above.*
}[/quote]
So, is he basically feeding current trough both pins? i dont get it, i really dont.
Of course, im probably just wrong about some basic shit and dont even know it, but, i want to know what is it im not gettin, you know, for science.