I'm new to electronics and i'm trying to experiment on my new project.
Here's what i am trying to do:
I want to turn on leds one by one using a PIC16F84A programed by the following program:
'Binary progression counting
'Initialize variables
Symbol TRISB=134 'Assign TRISB port to 134
Symbol TRISB= 6 'Asing the variable portB the decimal value 6
'Initialize Port(s)
Poke TRISB, 0 'Set port B pins to output
loop:
B0= 1 'Set variable to 1 to start
B1= 0 'Set variable to 0
Poke PortB, B0 'Place B0 value at port to light leds
Pause 250
For B2= 0 to 6
B1= B0 * 2 'Calculate next binary progressiv number
B0 = B1 'Set B0 to new value
Poke PortB, B0 'Place new value at port to light leds
Pouse 250
Next B2 'Next loop value
Goto loop
I have decided to use 3 button cells (Bat2-bat9) for every led each 1.5V. I guess leds will shine forever.
Since this is my first project i'd like some advices.
What if switched the 4066 with a 4016?
Will it work????
http://www.geocities.com/micogjergji/74HCT4066.pdf
http://www.geocities.com/micogjergji/mmc4016.pdf
http://www.geocities.com/micogjergji/shume.tif
Here's what i am trying to do:
I want to turn on leds one by one using a PIC16F84A programed by the following program:
'Binary progression counting
'Initialize variables
Symbol TRISB=134 'Assign TRISB port to 134
Symbol TRISB= 6 'Asing the variable portB the decimal value 6
'Initialize Port(s)
Poke TRISB, 0 'Set port B pins to output
loop:
B0= 1 'Set variable to 1 to start
B1= 0 'Set variable to 0
Poke PortB, B0 'Place B0 value at port to light leds
Pause 250
For B2= 0 to 6
B1= B0 * 2 'Calculate next binary progressiv number
B0 = B1 'Set B0 to new value
Poke PortB, B0 'Place new value at port to light leds
Pouse 250
Next B2 'Next loop value
Goto loop
I have decided to use 3 button cells (Bat2-bat9) for every led each 1.5V. I guess leds will shine forever.
Since this is my first project i'd like some advices.
What if switched the 4066 with a 4016?
Will it work????
http://www.geocities.com/micogjergji/74HCT4066.pdf
http://www.geocities.com/micogjergji/mmc4016.pdf
http://www.geocities.com/micogjergji/shume.tif
Last edited by a moderator: