Pages: 1 [2]   Go Down
Author Topic: Charlieplexing  (Read 2828 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using transistor will be of some help, or just waste of money.
Logged


Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hey Onions have you gotten around to running the script yet?

Not yet... I have been going through LEDs thick and fast recently, using 40 of them
in several LED cubes (one of them is still in progress), and as signal lights in other projects.
I will need to go out this weekend to buy in some more, as I do not have enough lieing
around  smiley-sad.

Just a quick note:
A 10X10X10 LED cube can be controlled by an arduino duemillanove / Uno!
Using 11 pins, all charlieplexed into an grid, will give control 110 LEDs for the coloumbs.
Use all the analog inputs as two seperate charlieplexing grids, or just use the 10
spare from the main ones and you can control all the layers too!

Using 1000 LEDs for a cube is slightly out of my budget though, so I will
not build it, and the atmega328 might not have enough memory, but
I posted it so anyone else can try, should they want to!

Onions.  smiley-grin

Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Georgia, US
Offline Offline
Sr. Member
****
Karma: 5
Posts: 371
Arduino makes my head hurt :(
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm.. I've just been tearing down projects after building them, I only have one 600 pin breadboard and one 30 or so

But my projects are so far limited to make a led flash, turn it on with a button, make two flash oh crap that didn't work, use two inputs to make two flash, make a row of 10 or so and light them in order, charlieplex some together and light them, LCD screen, charlieplex using 6 outputs..


Haven't done anything since then, should probably do something this weekend
Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again!

I've finally got round to buying some LEDs and running the code. It
works nicely, but it is a bit boring. As a result, I had the LED select
chosen by a random number. This did not seem to be random though,
so I went onto random.org to create some true random number
strings. I then used these as the LED select numbers. This makes it
completely un-random, or pre selected, but it seems quite the opposite.

The new code is here:

Code:
int number;
int position = 0;
char sequence[] = {5,4,2,6,3,1,6,5,3,2,4,1,6,5,4,1,3,2,4,5,3,6,2,1,4,2,6,3,5,1,1,4,3,2,5,6,4,1,5,6,2,3,0};

void setup(){}

void loop(){
  number = sequence[position];
  if(number == false){
    position = 0;
    number = sequence[position];
  }
  
   pinMode(4, OUTPUT);
   pinMode(3, OUTPUT);
   pinMode(2, OUTPUT);
    digitalWrite(2, LOW);      //turn all the pins low
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
      
    switch(number){      //turn on the correct pins for the LED selected:
    
      case 1:
      pinMode(2, INPUT);
      pinMode(3, OUTPUT);
      pinMode(4, OUTPUT);
      digitalWrite(3, LOW);
      digitalWrite(4, HIGH);
      break;
      
      case 2:
      pinMode(2, INPUT);
      pinMode(3, OUTPUT);
      pinMode(4, OUTPUT);
      digitalWrite(3, HIGH);
      digitalWrite(4, LOW);
      break;
      
      case 3:
      pinMode(3, INPUT);
      pinMode(2, OUTPUT);
      pinMode(4, OUTPUT);
      digitalWrite(2, HIGH);
      digitalWrite(4, LOW);
      break;
      
      case 4:
      pinMode(3, INPUT);
      pinMode(2, OUTPUT);
      pinMode(4, OUTPUT);
      digitalWrite(4, HIGH);
      digitalWrite(2, LOW);
      break;
      
      case 5:
      pinMode(4, INPUT);
      pinMode(3, OUTPUT);
      pinMode(2, OUTPUT);
      digitalWrite(2, HIGH);
      digitalWrite(3, LOW);
      break;
      
      case 6:
      pinMode(4, INPUT);
      pinMode(3, OUTPUT);
      pinMode(2, OUTPUT);
      digitalWrite(3, HIGH);
      digitalWrite(2, LOW);
      break;
      
      default:
      break;
    }
    delay(100);
    position++;
}
      
      

And some pictures...

                                   

Plus a video (if it works):






Although it looks bad in the video, it is due to the poor video quality of my camera.
Onions.
« Last Edit: January 29, 2011, 04:24:10 pm by Onions » Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again!

I've finally got round to buying some LEDs and running the code. It
works nicely, but it is a bit boring. As a result, I had the LED select
chosen by a random number. This did not seem to be random though,
so I went onto random.org to create some true random number
strings. I then used these as the LED select numbers. This makes it
completely un-random, or pre selected, but it seems quite the opposite.

Wow that's pretty neat! I want to try that sometime. Maybe I'll use one of my spare 328's to build something cool.

Also, I think that what you did is basically what the normal kind of random number generator does. As far as I know, they get a ton of truly random numbers and cycle through them (they might vary the length of the cycles, but you get the idea).
Logged

Massachusetts
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Build On!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice work! Just began dabbling in the whole Arduino world. Excellent way to keep my brain moving. Have been trying charlieplexing to do some basic LED stuff and was having problems driving 5 or more. Upon stumbling on your post and seeing your code it all became clear! Once again, build on!
Logged

Pages: 1 [2]   Go Up
Jump to: