The micro I will be using is an Atmel Attiny2313.
Remove these ads by
Signing UpStep 1Parts and Tools
Attiny2313 (got 5 free samples from Atmel)
20 pin socket
Resistors (any size will work, depending on your setup. I will explain later)
5v regulator (any will work, I'm using an LM340)
Transistors or Mosfets (easiest to find and cheapest ones are usually 2n3904's. Just make sure it's an NPN transistor, or an N-Channel Mosfet)
2 small Capacitors (look up data sheet for regulator, .1uf and .22uf with LM340)
Lots of LED's
Some protoboard or a breadboard
Any programmer for the AVR
Wire
Tools:
Soldering Iron
| « Previous Step | Download PDFView All Steps | Next Step » |












































// code left shift
byte = 0x01; //0b00000001
for(x=0; x<7; x++){
PORT = byte;
byte << 1;
_delay_ms(200);
}
// code right shift
byte = 0x40; //0b01000000
for(x=0; x<7; x++){
PORT = byte;
byte >> 1;
_delay_ms(200);
}
// code fill right
byte = 0x40; //0b01000000
for(x=0; x<7; x++){
PORT = byte;
byte >> 1;
byte |= 0x40;
_delay_ms(200);
}
REGARDS FROM BULGARIA
(BTW, your LEDs are drawn reversed in the schematic.)
If you put (say) 15mA through a green, a blue, a red and a yellow LED (taking the Vf into consideration), the green will appear brighter than the blue, the blue brighter than the red etc. because of different efficiencies of the LEDs and the eye's sensitivity to the different colours.
For my project, I initially did the calculations for the same current through each colour LED and found it no good at all, so I chose the resistor values by 'eyeballing' it.