jensmith25
Senior Member
Hi all,
I've had an enquiry as to the possibility of controlling the speed of flicker using a potentiometer for dolls house fireplaces / candles. They've seen an available unit (probably from China) and asked if I can do something similar.
What I'm using:
PCB: 18M2 project board / high power project board
10k analogue potentiometer on C.0
4.5v
I have created a welding effect simulation similar to this chap's http://www.picaxeforum.co.uk/showthread.php?27514-08M2-welder-flicker-simulation&highlight=welding+simulation
Code snippet:
which uses the tune command and is very effective but in this case I need it to be more of a random flicker and without the additional LED and for the 18M2.
I've also seen this option which flashes an LED but this is a flash rather than a random flicker:
Is it even possible to alter the speed of flicker using a potentiometer?
I've tried using a flickering LED but it needs a certain current to light and using the potentiometer seems to have no effect. It stops flickering when turned low.
Can you:
1) Use a potentiometer in combination with the tune command to alter the speed of the flicker?
or is there another way of doing it?
I considered whether I could use the tune command and just choose different tunes so a slow one to start, getting faster and use the
idea to call the different tunes but I don't know how well this would work.
I'm still a newbie at Picaxe coding so please bear with me.
Thanks,
Jennifer,
I've had an enquiry as to the possibility of controlling the speed of flicker using a potentiometer for dolls house fireplaces / candles. They've seen an available unit (probably from China) and asked if I can do something similar.
What I'm using:
PCB: 18M2 project board / high power project board
10k analogue potentiometer on C.0
4.5v
I have created a welding effect simulation similar to this chap's http://www.picaxeforum.co.uk/showthread.php?27514-08M2-welder-flicker-simulation&highlight=welding+simulation
Code snippet:
Code:
#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
etc etc
I've also seen this option which flashes an LED but this is a flash rather than a random flicker:
Code:
main:
for b1 = 1 to 5
call flash
next
call delay
goto main
flash:
high C.1
low C.4
readadc C.2, b0
let w1 = 5 * b0
pause w1
low C.1
high C.4
readadc C.2, b0
let w1 = 5 * b0
pause w1
return
delay:
low C.1
low C.4
pause 2000
return
I've tried using a flickering LED but it needs a certain current to light and using the potentiometer seems to have no effect. It stops flickering when turned low.
Can you:
1) Use a potentiometer in combination with the tune command to alter the speed of the flicker?
or is there another way of doing it?
I considered whether I could use the tune command and just choose different tunes so a slow one to start, getting faster and use the
Code:
main: readadc 0,b1 ‘ read value on pin0 into variable b1
if b1<75 then light1 ‘ if b1 is less than 75 then light 1
if b1<175 then light2 ‘ if b1 is less than 175 then light 2
goto light3 ‘ if b1 is greater than 175 then light 3
I'm still a newbie at Picaxe coding so please bear with me.
Thanks,
Jennifer,