so here it is:
and the code:
My first one ever.. sorry if it's a little hard to follow. Here's the vid of it working: http://www.youtube.com/watch?v=fpeS-HkaYHU
On the top is the 5V reg with the suppression caps and such... everything bellow that that says 5v connects to this reg... thanks again for that schematic hippy.. just one thing though, the 0.22uF cap connected through the 47R, how many watts does that 47R need to be? just a regular old 1/2watt?
First question is about using the interrupt command for the brakes.. you see there is an empty input.. and I have another PWMout.. I am thinking that if my brakes are too bright maybe I would want to use the second PWM signal to drive them.. but using the interrupt if a signal light is on and I hit the brake, would it stop blinking? ..I suppose the best way is to code it in and check it out, but I wanted to look into the speed of things aswell... the way it's set up now the brake signal just switches the regs on full time.. so it's instant.. one of the big reasons why LEDs make great brake lights is the instant on compared to incandescent can save you 20 meters at highway speed... I don't want to negate that advantage by putting the brakes through code and slowing down the response... so how much slower would an interrupt be than what I have wired right now? ..I can always stick with this and just go with bigger resistors for the LEDs if I think I need to dim them down a bit.
Second question is about the +12v inputs.. This is something I hadn't thought of until I drew up the circuit.. I don't imagine I can just feed these 12V inputs into the picaxe to turn on the signals or the markers... what's the best way to deal with this? switch some transistors connected to the 5v line? or use a voltage divider?
Thanks! I really appreciate all the help I've been getting here to build this project... couldn't have done it without you guys.
edit: the whole idea behind a 2amp fuse on each reg for the marker/brakes is that is one of them blows the load will be low enough that 2 regs can take up the slack and run a little hotter keeping the tails working until the fuse and blown reg are replaced (should the need ever arise) The whole thing is very over built.. I don't know exactly how many LEDs I'll be using yet, but I imagine I'll be drawing less than half the power available.
second edit: forgot to mention that the caps on the regs aren't included in the diagram because they're already soldered onto the pins SMT style.
and the code:
Code:
main:
readadc 0,b0
readadc 1,b1
readadc 2,b2
b3 = 4
w1 = b2 * b3
If pin5 = b4 Then ' No change in pin 5
If b4 = 1 Then ' Pin 5 is high ...
PwmDuty 1, b2 ' ... Update duty only
End If
Else ' Pin 5 changed
b4 = b4 ^ 1 ' Update b4 to reflect pin 5
If b4 = 1 Then ' Pin 5 went high ...
PwmOut 1, 255, w1 ' ... Start PWM
Else ' Pin 5 went low ...
PwmOut 1 off ' ... Turn off PWM
End If
End If
if pin0 = 1 and pin3 = 1 then flashhazard
if pin0 = 1 then flashleft
if pin3 = 1 then flashright
if pin0 = 0 and pin3 = 0 then main
goto main
flashleft:
high portc 7
high 0
pause b0
high 1
pause b0
high 2
pause b0
high 3
pause b0
high 4
pause b0
high 5
pause b0
high 6
pause b0
high 7
pause b1
low 7
pause b1
low 6
pause b1
low 5
pause b1
low 4
pause b1
low 3
pause b1
low 2
pause b1
low 1
pause b1
low 0
pause b1
pause 50
low portc 7
goto main
flashright:
high portc 6
high 0
pause b0
high 1
pause b0
high 2
pause b0
high 3
pause b0
high 4
pause b0
high 5
pause b0
high 6
pause b0
high 7
pause b1
low 7
pause b1
low 6
pause b1
low 5
pause b1
low 4
pause b1
low 3
pause b1
low 2
pause b1
low 1
pause b1
low 0
pause b1
pause 50
low portc 6
goto main
flashhazard:
high portc 7
high portc 6
high 0
pause b0
high 1
pause b0
high 2
pause b0
high 3
pause b0
high 4
pause b0
high 5
pause b0
high 6
pause b0
high 7
pause b1
low 7
pause b1
low 6
pause b1
low 5
pause b1
low 4
pause b1
low 3
pause b1
low 2
pause b1
low 1
pause b1
low 0
pause b1
pause 50
low portc 7
low portc 6
goto main
On the top is the 5V reg with the suppression caps and such... everything bellow that that says 5v connects to this reg... thanks again for that schematic hippy.. just one thing though, the 0.22uF cap connected through the 47R, how many watts does that 47R need to be? just a regular old 1/2watt?
First question is about using the interrupt command for the brakes.. you see there is an empty input.. and I have another PWMout.. I am thinking that if my brakes are too bright maybe I would want to use the second PWM signal to drive them.. but using the interrupt if a signal light is on and I hit the brake, would it stop blinking? ..I suppose the best way is to code it in and check it out, but I wanted to look into the speed of things aswell... the way it's set up now the brake signal just switches the regs on full time.. so it's instant.. one of the big reasons why LEDs make great brake lights is the instant on compared to incandescent can save you 20 meters at highway speed... I don't want to negate that advantage by putting the brakes through code and slowing down the response... so how much slower would an interrupt be than what I have wired right now? ..I can always stick with this and just go with bigger resistors for the LEDs if I think I need to dim them down a bit.
Second question is about the +12v inputs.. This is something I hadn't thought of until I drew up the circuit.. I don't imagine I can just feed these 12V inputs into the picaxe to turn on the signals or the markers... what's the best way to deal with this? switch some transistors connected to the 5v line? or use a voltage divider?
Thanks! I really appreciate all the help I've been getting here to build this project... couldn't have done it without you guys.
edit: the whole idea behind a 2amp fuse on each reg for the marker/brakes is that is one of them blows the load will be low enough that 2 regs can take up the slack and run a little hotter keeping the tails working until the fuse and blown reg are replaced (should the need ever arise) The whole thing is very over built.. I don't know exactly how many LEDs I'll be using yet, but I imagine I'll be drawing less than half the power available.
second edit: forgot to mention that the caps on the regs aren't included in the diagram because they're already soldered onto the pins SMT style.
Last edited: