Hi everyone,
I am currently trying to make a 7x6 LED array with bicolor (3-legged) LEDs. I am just planning to make it programmable (noscrolling, etc.) for making a Connect 4 game.
Here is the current circuit that I made in TinkerCAD. Since TinkerCAD doesn't have any bicolor LED, I am using RGB led for this diagram. (Click for imgur link):
Since I am planning to add additional 15 buttons (later) and this LED arrangement already need around 19 pins (CMIIW), I am multiplexing this with the help of 3 Johnson decade counter (4017). This is my first time using decade counter, so I don't know much about it yet despite reading tutorials.
If you try to simulate it, you can see that the third row is turned on. That kinda puzzled me. But, I am sure that my circuit design is not right, let alone the code.
Can anyone help me to point out what's wrong and what should I do with the circuit? I would really appreciate your help, thank you so much!
(If you're wondering about my current code, this is my code):
int cathodeClockPin = 5;
int cathodeResetPin = 4;
int blueClockPin = 3;
int blueResetPin = 2;
int greenClockPin = 7;
int greenResetPin = 6;
void setup()
{
pinMode(cathodeClockPin, OUTPUT);
pinMode(blueClockPin, OUTPUT);
pinMode(greenClockPin, OUTPUT);
pinMode(cathodeResetPin, OUTPUT);
pinMode(blueResetPin, OUTPUT);
pinMode(greenResetPin, OUTPUT);
// Reset 4017s
digitalWrite(cathodeResetPin, HIGH);
digitalWrite(blueResetPin, HIGH);
digitalWrite(greenResetPin, HIGH);
delayMicroseconds(5);
digitalWrite(cathodeResetPin, LOW);
digitalWrite(blueResetPin, LOW);
digitalWrite(greenResetPin, LOW);
}
void clock()
{
// Commented out.
/*
digitalWrite(cathodeClockPin,HIGH);
digitalWrite(blueClockPin,HIGH);
delay(1);
digitalWrite(cathodeClockPin,LOW);
digitalWrite(blueClockPin,LOW);
PORTD=B00000000;
*/
}
void loop()
{
clock();
// Delay a little bit to improve simulation performance
// (Comment from TinkerCAD)
delay(10);
}