' demo of ws2812 pixel strips
' a complete help of Annex32 can be found here
' https://cicciocb.com/annex32help/V1.482/
'requires Annex32 1.48.2

neo.setup 13, 16*2 'set 16 x 2 leds on the pin GPIO13
neo.clear 0

col1 = &hff0000 'red
col2 = &h00ff00 'green
col3 = &h0000ff 'blue
col4 = &hff00ff 'magenta

'Set the refresh rate of the display (50 msec) - lower values -> scroll faster
timer0 50, scrollme
progress = 0
dir = 0.01
angle = 0
wait

Scrollme:
c1 = neo.linearblend(col1, col2, progress)
neo.strip 0, 15,  c1, 1
progress = progress + dir
if (progress <= 0) or (progress >= 1) then dir = -dir

x = (cos(angle) + 1) / 2
y = (sin(angle) + 1) / 2
c2 = neo.bilinearblend(col1, col2, col3, col4, x, y)
neo.strip 16, 31, c2, 1
angle = angle + PI/100

neo.refresh
return