Charlieplexing - Trouble with illuminating multiple LEDs
hi guys,
i'm trying charlieplex 10 leds atmega328p. far works fine when illuminate led's individually. however, gets bit strange when try illuminate multiple leds.
for example, when try drive leds 2 , 4, led 3 illuminated.
here circuit , code i'm using:
i can't figure out why happening, ideas?
i'm trying charlieplex 10 leds atmega328p. far works fine when illuminate led's individually. however, gets bit strange when try illuminate multiple leds.
for example, when try drive leds 2 , 4, led 3 illuminated.
here circuit , code i'm using:
code: [select]
int count = 0;
void setup() {
// put setup code here, run once:
}
void loop() {
led2();
led4();
}
void led1()
{
pinmode(16, input);
digitalwrite(16, low);
pinmode(17, input);
digitalwrite(17, low);
pinmode(18, output);
pinmode(19, output);
digitalwrite(19, high);
digitalwrite(18, low);
}
void led2()
{
pinmode(16, input);
digitalwrite(16, low);
pinmode(17, input);
digitalwrite(17, low);
pinmode(18, output);
digitalwrite(18, high);
pinmode(19, output);
digitalwrite(19, low);
}
void led3()
{
pinmode(16, input);
digitalwrite(16, low);
pinmode(19, input);
pinmode(19, low);
pinmode(17, output);
pinmode(18, output);
digitalwrite(18, high);
digitalwrite(17, low);
}
void led4()
{
pinmode(16, input);
digitalwrite(16, low);
pinmode(19, input);
digitalwrite(19, low);
pinmode(17, output);
digitalwrite(17, high);
pinmode(18, output);
digitalwrite(18, low);
}
void led5()
{
pinmode(16, input);
digitalwrite(16, low);
pinmode(18, input);
digitalwrite(18, low);
pinmode(17, output);
digitalwrite(17, low);
pinmode(19, output);
digitalwrite(19, high);
}
void led6()
{
pinmode(16, input);
digitalwrite(16, low);
pinmode(18, input);
digitalwrite(18, low);
pinmode(17, output);
digitalwrite(17, high);
pinmode(19, output);
digitalwrite(19, low);
}
void led7()
{
pinmode(19, input);
digitalwrite(19, low);
pinmode(18, input);
digitalwrite(18, low);
pinmode(17, output);
digitalwrite(17, high);
pinmode(16, output);
digitalwrite(16, low);
}
void led8()
{
pinmode(19, input);
digitalwrite(19, low);
pinmode(18, input);
digitalwrite(18, low);
pinmode(17, output);
digitalwrite(17, low);
pinmode(16, output);
digitalwrite(16, high);
}
void led9()
{
pinmode(19, input);
digitalwrite(19 ,low);
pinmode(17, input);
digitalwrite(17, low);
pinmode(18, output);
digitalwrite(18, high);
pinmode(16, output);
digitalwrite(16, low);
}
void led10()
{
pinmode(19, input);
digitalwrite(19, low);
pinmode(17, input);
digitalwrite(17, low);
pinmode(18, output);
digitalwrite(18, low);
pinmode(16, output);
digitalwrite(16, high);
}
i can't figure out why happening, ideas?
the point charlyplexing light 1 led @ time. if want more multiplex them, flash them on , off rapidly looks there more 1 on @ once.
Arduino Forum > Using Arduino > LEDs and Multiplexing > Charlieplexing - Trouble with illuminating multiple LEDs
arduino
Comments
Post a Comment