Ok so i'm making a led cube and all that's left to do is program the arduino.
/*
*3D LED Cube (Preliminary Code)
*Counts to 25 then convert to Binary and Light Cube
*
*/
int ledPins[6];
int pinCount = 6;
int iterations = 24;
int timer = 100;
void setup() {
int pins;
for(int pins = 0; pins < pinCount; pins++) {
pinMode(ledPins[pins],OUTPUT);}
// pinMode(2, OUTPUT); // Sets pin '2' as LSB
// pinMode(3, OUTPUT); //
// pinMode(4, OUTPUT); // COMMENTED OUT; SMALLER CODE ABOVE
// pinMode(5, OUTPUT); //
// pinMode(6, OUTPUT); // Sets pin '6' as MSB
}
void loop(){
int Iiterations;
for(int Iiterations = 0; Iiterations < iterations; Iiterations++) {
digitalWrite (6,HIGH);
}
}
The program above is what i have so far...but just for starters im only going to light up the top layer of cube in a counting sequence to help me understand arduino better. Now what i have my arduino connected to is 2(two) 74hc4514 4:16 demultiplexers. I only want to use 5-6 outputs on my arduino to control the cube using binary code to select an led
EX: 00000 = Led 1; 00001 = led 2;......01010 = led 11.
The issue that i'm having is i want to store each individual bit in the array.
EX: The binary 0(zero) will be stored in the array as 0|0|0|0|0; 1 = 0|0|0|0|1........ect.
I know how to convert to binary but as far as separating the number and storing these values i get stuck...
... Im not asking anyone to write the code or anything but what is the best method to go about doing this??