Hi,
I'm starting a new project on which I need to command 512 leds (On/Off).
I want to be able to pass a decimal number (n) as a variable to the arduino Uno to command the (n)th led associated.
Eg:
int n = 512; => I would like to switch on the 512th led only.
int n = 114; => I would like to switch on the 114th led only.
I thought of converting the decimal number "n" as a 10 bits binary number, so at this point, I can command 10 leds :
Eg :
int n = 1;
// Converted as a 10 bits binary with a function :
int binary[] = {0,0,0,0,0,0,0,0,0,1}; // So only the right led will switch on
int n = 512;
int binary[ ] = {1,0,0,0,0,0,0,0,0,0};
I know this is possible using logical gates, but just for the matter of switching on the first led only when I have {0,0,0,0,0,0,0,0,0,1}, I needed 11 NPN transistors... (To build the AND and NOT gates).
Because obviously, I wanted the first bit to be switched on, and nothing else.
So for 512 leds, connected to their corresponding bits sequences I'm afraid I will need so much transistors, and also what a fastidious job to solder everything together...
So I would like to ask you if there is any electronical component (Or schema) that I could use to convert a 10 bits sequence to its corresponding output.
In summary : I pass 512 as an int to arduino, it converts to 1000000000, then the 512th output receive current and switches on the 512th led.
NB: I would like to apology because English is not my native language, and I'm also a noob in electronics if that question sounds dumb to you.
Anyway, thank you very much to anybody that could help me on this

