Light animation Rule

Hello guys,

I have an arduino vith attached one neopixel adafruit RGB led.

Is possible to write a rule to create some colors animation?

I’d try that one but doesn’t work

Rule:

rule "Neopixel Light Animation TEST"
when 
	Item Neopixel_Animation changed
then
	var i = 0
		while((i=i+1) == 255) {
		val redValue   = (256-i).toString
	    val greenValue = (256/i).toString
	    val blueValue  = (i).toString
	    val color = redValue + "," + greenValue + "," + blueValue
	    sendCommand(Neopixel_Int_Colore, color)
	    Thread::sleep(400)
	}
end

Items

 String Neopixel_Int_Colore																			{mqtt=">[mosquitto:Int/L/RGB_1_in/RGB:state:*:default]"}
Number Neopixel_Animation							"Effetti Luminosi"	<rgb>						{mqtt=">[mosquitto:Int/L/RGB_1_in/A:command:*:default]"}`

Sitemap
Selection item=Neopixel_Animation mappings=[0=OFF, 1=Animation]

Thanks in advance

this rule won’t fly because you tell it to run while i equals 255, which it never will.
try:
while((i=i+1) < 255)
telling it to run while i is smaller 255

@Oli yeah, my fault. You are right