August 19th, 2014, 01:08 PM
by Doc
This is a project I did in my truck. I posted it in Savage.circuits v1.0 so I think I'll re-post it here on Savage.circuits v2.0. It uses a BS1 and some really bright blue LEDs.

This is the panel from the dash that I modified. The row of LEDs across the top and a potentiometer in the middle. It's a multi-turn, if that's the right word, pot - perhaps too many turns to change the rate of flash. You almost have to spin it, but it allows for fine tuning of the flash rate. A toggle switch for power control. Neat little face plate I salvaged from something, I don't recall.

Another view of the front. I'm not sure the LEDs are perfectly strait.


A view of the back. The BS1 is shown here on the small perf-board. The BS1 uController directly drives the LEDs and inputs for the potentiometer. Power is through a fuse box that is hot when ignition is on.

Better angle on the board. The black, round component behind the red wires is the Pot. I love the giant ceramic capacitor I dug out of my junk box!

This is supposed to show the heat shrink around the LED leads. It also shows the hot-glue I used on the LEDs and circuit board. That was fun (messy).

From the right side.

From the bottom view. Minimal soldering here.


And the top view. See the common cathode connections below the heat shrink covered anodes?
Of course video is a must to fully enjoy!
https://youtu.be/Lc6MYYFAK6Y
Here's the BS1 code that controls the LEDs:
Code: Select all
' {$STAMP BS1}
' {$PBASIC 1.0}
'sequence 7 LEDs from center out and back
SYMBOL thePin = B2 '
SYMBOL flashRate = B3 'variable for delay
SYMBOL theCount = B4 'varible for loop counters
SYMBOL CenterLED = 4 'pin for center LED
SYMBOL POTPIN = 0 'input pin for Potentiometer reading
GOTO GetRate
GOTO Main
Main:
GOSUB GetRate
HIGH CenterLED
PAUSE flashRate
LOW CenterLED
PAUSE flashRate
FOR theCount = 1 TO 3
GOSUB GetRate
thePin = CenterLED - theCount
HIGH thePin
thePin = CenterLED + theCount
HIGH thePin
PAUSE flashRate
thePin = CenterLED - theCount
LOW thePin
thePin = CenterLED + theCount
LOW thePin
PAUSE flashRate
NEXT
FOR theCount = 2 TO 1 STEP -1 ' use 3 instead of 2 to get double flash at ends
GOSUB GetRate
thePin = CenterLED - theCount
HIGH thePin
thePin = CenterLED + theCount
HIGH thePin
PAUSE flashRate
thePin = CenterLED - theCount
LOW thePin
thePin = CenterLED + theCount
LOW thePin
PAUSE flashRate
NEXT
' GOSUB GetRate 'uncomment these lines to get double flash in center
' HIGH CenterLED
' PAUSE flashRate
' LOW CenterLED
' PAUSE flashRate
GOTO Main
GetRate:
POT POTPIN, 255, flashRate
RETURN
END