;Clear LEDn's to give chase effect
For index = 1 to 16
write8bit(PCA9635write, PWM(index), 0x00)
Next
;wave pattern: A four segment section walked across display
For index = 1 to 13
If index = 1 Then
write8bit(PCA9635write, PWM(index), 0xFF)
wait waitled
write8bit(PCA9635write, PWM(index), 0x96)
write8bit(PCA9635write, PWM(index+1), 0xFF)
wait waitled
write8bit(PCA9635write, PWM(index), 0x63)
write8bit(PCA9635write, PWM(index+1), 0x96)
write8bit(PCA9635write, PWM(index+2), 0xFF)
wait waitled
End If
write8bit(PCA9635write, PWM(index), 0x30)
write8bit(PCA9635write, PWM(index+1), 0x63)
write8bit(PCA9635write, PWM(index+2), 0x96)
write8bit(PCA9635write, PWM(index+3), 0xFF)
write8bit(PCA9635write, PWM(index), 0x00)
If index = 13 Then
Red = Random
Green = Random
Blue = Random
threshold1 = 175
threshold2 = 75
If Red < threshold1 & Red > threshold2 then Red = 0
If Green < threshold1 & Green > threshold2 then Green = 0
If Blue < threshold1 & Blue > threshold2 then Blue = 0
write8bit(PCA9635write, PWM(index + 1), Red)
write8bit(PCA9635write, PWM(index + 2), Green)
write8bit(PCA9635write, PWM(index + 3), Blue)
wait 1 s
'write8bit(PCA9635write, PWM(index + 1), 0x00)
'wait 10 10ms
'write8bit(PCA9635write, PWM(index + 2), 0x00)
'wait 10 10ms
'write8bit(PCA9635write, PWM(index + 3), 0x00)
End If
;PWMvalue = (index * 16) - 1
wait waitled
Next