9
911
Guest
Hi team,
Well Ive finally got round to playing with PIC's after getting pressure from Master BeanieBots - yes I'm lucky enough to work with him.
Anyhow, just for fun I'm making a A3 size LED sign to go in our games room. After talking with BenieBots, he recommended using PIC's to drive the LED circuits. This has given me flexibility to write and rewrite LED light flows ( I love these things , I wish they had them 30 years ago !).
Anyhow, the sign is split in to three sections. Two pictures and the third is words.
The first picture ( the easy one is running on a 08 that I had spare from a previous project. The only problem i have is space for coding.
The LED flow is very basic as well as the circuit.
Firstly the circuit, one out put is driven as a PWM connected to a transistor which in turn will fade up and down some LED's
Next we have three outputs driving a 74LS138 , which in turn drive 8 clusters of LED's ( through drivers of course).
Upon power up, the flow is
PWM up
PWM down
PWM up
Count to 8 , 5 times
return and start again ( I hope that makes sense)
Anyhow, running the code below ( which I'm not good at at all !) , I need to reduce so I can add more effects.
question, is it possible, is there some hidden space in the PIC I can use or combine the code in any way.
Many thanks in advance for your support.
Ade...
Main:
'low 0
'low 1
'low 2
gosub up
high 4
pause 1000
gosub down
low 4
pause 1000
gosub up
high 4
pause 1000
gosub BCD
pause 1000
gosub down
pause 1000
goto main
Up:
inc b5
pwm 4,b5,1
if b5 =255 then return
end if
goto up
Down:
dec b5
pwm 4,b5,1
if b5 =0 then return
end if
goto down
' Binary to Decimal convertor 74LS138
BCD:
pause 200
for b1 = 0 to 5 'Cycle 5 times
high 0 '1
low 1 '2
low 2 '4
' total = 1
gosub delay
low 0 '1
high 1 '2
' total = 2
gosub delay
high 0 '1
' total = 3
gosub delay
low 0 '1
low 1 '2
high 2 '4
' total = 4
gosub delay
high 0 '1
' total = 5
gosub delay
high 2 '4
low 0 '1
high 1 '2
' total = 6
gosub delay
high 0 '1
' total = 7
gosub delay
next b1
return
delay:
pause 300
return
Well Ive finally got round to playing with PIC's after getting pressure from Master BeanieBots - yes I'm lucky enough to work with him.
Anyhow, just for fun I'm making a A3 size LED sign to go in our games room. After talking with BenieBots, he recommended using PIC's to drive the LED circuits. This has given me flexibility to write and rewrite LED light flows ( I love these things , I wish they had them 30 years ago !).
Anyhow, the sign is split in to three sections. Two pictures and the third is words.
The first picture ( the easy one is running on a 08 that I had spare from a previous project. The only problem i have is space for coding.
The LED flow is very basic as well as the circuit.
Firstly the circuit, one out put is driven as a PWM connected to a transistor which in turn will fade up and down some LED's
Next we have three outputs driving a 74LS138 , which in turn drive 8 clusters of LED's ( through drivers of course).
Upon power up, the flow is
PWM up
PWM down
PWM up
Count to 8 , 5 times
return and start again ( I hope that makes sense)
Anyhow, running the code below ( which I'm not good at at all !) , I need to reduce so I can add more effects.
question, is it possible, is there some hidden space in the PIC I can use or combine the code in any way.
Many thanks in advance for your support.
Ade...
Main:
'low 0
'low 1
'low 2
gosub up
high 4
pause 1000
gosub down
low 4
pause 1000
gosub up
high 4
pause 1000
gosub BCD
pause 1000
gosub down
pause 1000
goto main
Up:
inc b5
pwm 4,b5,1
if b5 =255 then return
end if
goto up
Down:
dec b5
pwm 4,b5,1
if b5 =0 then return
end if
goto down
' Binary to Decimal convertor 74LS138
BCD:
pause 200
for b1 = 0 to 5 'Cycle 5 times
high 0 '1
low 1 '2
low 2 '4
' total = 1
gosub delay
low 0 '1
high 1 '2
' total = 2
gosub delay
high 0 '1
' total = 3
gosub delay
low 0 '1
low 1 '2
high 2 '4
' total = 4
gosub delay
high 0 '1
' total = 5
gosub delay
high 2 '4
low 0 '1
high 1 '2
' total = 6
gosub delay
high 0 '1
' total = 7
gosub delay
next b1
return
delay:
pause 300
return