08M2 welder flicker simulation


New Member
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.

'  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

' ============= Begin Main Program =============
	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
I am pleased with the effect it creates :rolleyes:, YMMD



Senior Member
Cobbled this together and it works great. Don't understand the 'Tune' command, fist argument is '3', supposed to refer to pin output, but the outputs are on physical pins 5 and 7 (c.2 & c.0 on 08M2) so what does the 3 stand for.
At anyrate this is great for my son-in-laws HO train layout.