Hello everyone,
I'm using this library for the Charlieplexing https://playground.arduino.cc/Code/Charlieplex/#Functions
I'm using pins 24,25,26 to help me light up 6 LEDs
Here are my defines
I'm able to get all 6 LEDs blinking and turning off in order... great! For now I'm just using 6 LEDs, in the future I will have to use 64.
The next thing I try to do is turn on LED 5, and 6 at the same time and by doing that you can take away the clear and delay function. It lights both of them up!
Next I try and turn LED 4,5,6
This doesn't work,
I get LED 1,2,3 to come on then it skips 4 and lights up 5,6
Does anyone know why this is happening, is there pull up resisters I need to disable?
Thank you for reading,
Joe
I'm using this library for the Charlieplexing https://playground.arduino.cc/Code/Charlieplex/#Functions
I'm using pins 24,25,26 to help me light up 6 LEDs
Here are my defines
Code:
#define NUMBER_OF_PINS 3
//define pins in the order you want to address them
byte pins[] = {24,25,26}; // 0 , 1 , 2
Charlieplex charlieplex = Charlieplex(pins,NUMBER_OF_PINS);
//individual 'pins' , address charlieplex pins as you would address an array
charliePin led1 = { 0 , 1}; //led1 is indicated by current flow from 12 to 13
charliePin led2 = { 1 , 2 };
charliePin led3 = { 0 , 2 };
charliePin led4 = { 1 , 0 };
charliePin led5 = { 2 , 1 };
charliePin led6 = { 2 , 0 };
boolean singleOn = false;
Here is the code that makes them blink and then cycle from LED1-6
Code:
if (singleOn){ charlieplex.clear(); }
delay(1000);
charlieplex.charlieWrite(led1,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led2,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led3,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led4,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led5,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led6,HIGH);
delay(5000);
singleOn=!singleOn;
I'm able to get all 6 LEDs blinking and turning off in order... great! For now I'm just using 6 LEDs, in the future I will have to use 64.
The next thing I try to do is turn on LED 5, and 6 at the same time and by doing that you can take away the clear and delay function. It lights both of them up!
Code:
if (singleOn){ charlieplex.clear(); }
delay(1000);
charlieplex.charlieWrite(led1,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led2,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led3,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led4,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led5,HIGH);
charlieplex.charlieWrite(led6,HIGH);
delay(5000);
singleOn=!singleOn;
Next I try and turn LED 4,5,6
Code:
//charlieplex.clear();
if (singleOn){ charlieplex.clear(); }
delay(1000);
charlieplex.charlieWrite(led1,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led2,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led3,HIGH);
delay(1000);
charlieplex.clear();
charlieplex.charlieWrite(led4,HIGH);
charlieplex.charlieWrite(led5,HIGH);
charlieplex.charlieWrite(led6,HIGH);
delay(5000);
singleOn=!singleOn;
This doesn't work,
I get LED 1,2,3 to come on then it skips 4 and lights up 5,6
Does anyone know why this is happening, is there pull up resisters I need to disable?
Thank you for reading,
Joe