I have played around with eclectic's code and I am happy with the results. i have noticed that blue and green and more powerful than the red and have reduced the values of bTime and gTime. This has helped, although I am not getting the colour seperation between blue and green that I want. I have used "random" to change the intensities of R, B, and G. The biggest difference is with red, blue and green just mixing.
With "do...loop" left in Strobe_Eyes, the pulse is eliminated, which I don't want. As well, the code did not end after a 15 count but just kept going. I would like Strobe_Eyes to last 15 seconds, but not sure how to achieve this.
Code:
#18M2 RGB Witch Eyes
symbol R_Eyes = B.4
symbol B_Eyes = B.5
symbol G_Eyes = B.6
symbol Dummy = B.7
symbol Trigger = pinC.1
symbol Decay = w13
symbol rTime = b12
symbol bTime = b14
symbol gtime = b16
symbol xtime = w9
do
let w10 =time
random w10
let w11 = time
random w11
let w12 = time
random w12
rTime = w10//50+255
bTime = w11//5+150
gTime = w12//5+125
xTime = 766 - rTime - bTime - gTime
PulsOut R_Eyes, rTime
PulsOut B_Eyes, bTime
PulsOut G_Eyes, gTime
PulsOut DUMMY, xTime
if Trigger =1 then
gosub Strobe_Eyes
endif
loop
Strobe_Eyes:
Do
Decay =15
for rTime = 50 to 255 step 2
for bTime = 20 to 150 step 2
for gTime = 10 to 80 step 2
xTime = 766 - rTime - gTime - bTime
PulsOut R_Eyes, rTime
PulsOut B_Eyes, bTime
PulsOut G_Eyes, gTime
PulsOut DUMMY, xTime
Decay = Decay-1
Loop until Decay = 0
next
next
next
return