Hi all,
Well I'm sure others have done this, but here is my two pennuth.
I wanted to simulate the flicker of a welding torch / mig welder for our garden railway layout.
So using ultra-bright blue and white LEDs I wrote this simplistic program.
I am pleased with the effect it creates , YMMD
Martin
Well I'm sure others have done this, but here is my two pennuth.
I wanted to simulate the flicker of a welding torch / mig welder for our garden railway layout.
So using ultra-bright blue and white LEDs I wrote this simplistic program.
Code:
' This program runs on a PICAXE-08M2.
' Used to flicker LEDs on pin 5 & 7
' to simulate welding flicker
' Wire white LED from pin 5 to ground via suitable resistor
' Wire blue LED from pin 7 to ground via a suitable resistor
' I used 220R resistors in both cases.
' The original 'tune' was The Magic Roundabout theme ring tone!!
' === Directives ===
#picaxe 08M2 ' specify processor
w0=0
w1=0
' ============= Begin Main Program =============
do
random w0
let w1 = b0*21
tune 3, 2,($27,$67,$67,$22,$22,$24,$64,$64,$20,$20,$25,$65,$65,$20,$20,$26,$66)
pause w1
random w0
let w1 = b0*25
tune 3, 2,($27,$67,$67,$22,$22,$24,$64)
pause w1
random w0
let w1 = b0*19
tune 3, 2,($27,$67,$67,$22,$22,$24,$64,$64,$20,$20,$25)
pause w1
loop 'carry on indefinately
end
Martin