random LEDs on using the LOLShield and an Arduino
Switch LEDS off and on by column
[c]
#include <Charliplexing.h>
void setup()
{
LedSign::Init(); // initializes the screen
}
void loop()
{
for (int x=0; x<14; x++)
{
for (int y=0; y<9; y++)
{
LedSign::Set(x,y,1); // turns on LED at x,y
delay(50);
}
}
delay(500);
for (int x=0; x<14; x++)
{
for (int y=0; y<9; y++)
{
LedSign::Set(x,y,0); // turns on LED at x,y
delay(50);
}
}
delay(500);
}
[/c]
Now switch the LEDS on and off by rows
[c]
#include <Charliplexing.h>
void setup()
{
LedSign::Init(); // initializes the screen
}
void loop()
{
for (int y=0; y<9; y++)
{
for (int x=0; x<14; x++)
{
LedSign::Set(x,y,1); // turns on LED at x,y
delay(50);
}
}
delay(500);
for (int y=0; y<9; y++)
{
for (int x=0; x<14; x++)
{
LedSign::Set(x,y,0); // turns on LED at x,y
delay(50);
}
}
delay(500);
}
[/c]