In these Christmas holidays I have resumed an old strip of neopixel LEDs to decorate an environment.
The self-made controller use an old basic program for ESP8266.
I updated the controller with Annex but I stopped on a NEO.SHIFT instruction that I didn't find.
NEO.SHIFT ()
neo.shift ({start pixel}, {end pixel}, {direction, 1 for forward, -1 for reverse.})
Will display a shift effect. This allows some nice scrolling animations with very little effort.
I tried to do it again in basic, it works, but obviously it doesn't have the speed of the native command.
Is there a similar command in ANNEX?
Greetings and happy holidays.
NEO.SHIFT
-
- Posts: 222
- Joined: Mon Feb 15, 2021 1:44 pm
- Has thanked: 125 times
- Been thanked: 132 times
Re: NEO.SHIFT
That's strange. I've been doing a few things with small neopixel strips and the lack of a shift comand didn't register with me. I've been shifting my bits manually, but only for 12 neopixels or so. I'd have twigged if I'd been shifting more, I'm sure.
Go on Francesco, give us a SHIFT command
Go on Francesco, give us a SHIFT command
-
- Posts: 222
- Joined: Mon Feb 15, 2021 1:44 pm
- Has thanked: 125 times
- Been thanked: 132 times
Re: NEO.SHIFT
Hi Francesco.
Any chance of slipping this in?
It's an obvious complement to the neopixel switching commands.
NEO.SHIFT <From LED> <To LED> <Direction> or somesuch.
Any chance of slipping this in?
It's an obvious complement to the neopixel switching commands.
NEO.SHIFT <From LED> <To LED> <Direction> or somesuch.
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
Re: NEO.SHIFT
HI all,
I played with neoxpixels on the web simulator a little bit and I'm in the process to include these commands in the next coming release.
https://wokwi.com/projects/346887874044494420
This demo shows what can be done; included in the demo there is a little explanation on the new commands available.
I'm open to accept any suggestions about the possibility to include new commands.
This will be a nice addition for the next coming holidays.
I played with neoxpixels on the web simulator a little bit and I'm in the process to include these commands in the next coming release.
https://wokwi.com/projects/346887874044494420
This demo shows what can be done; included in the demo there is a little explanation on the new commands available.
I'm open to accept any suggestions about the possibility to include new commands.
This will be a nice addition for the next coming holidays.
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
- Electroguard
- Posts: 867
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 278 times
- Been thanked: 324 times
Re: NEO.SHIFT
Thanks for the NEO additions, and some feedback...
I see that SHIFT moves pixels along until they drop off the end, whereas ROTATE wraps them back around.
Are there any examples of NEO.BILINEARBLEND anywhere ?
NEO.DIM is handy, but of course once the r,g,b ratio can no longer be maintained it turns into a colour changer.
To act just as a dimmer requires preventing any further value changes that would cause any r,g,b value to become less than 0 or greater than 255, but NEO.DIM does not have any such optional limit.
Which means the r,g,b values need to be monitored to ensure they do not exceed limits. But all the NEO functions return a single combined RGB value, not the individual r,g,b components... so perhaps NEO.GETPIXEL might optionally be able to return the 3 individual r,g,b values.
Or something like a NEO.SPLIT function might be generally more useful for splitting a single combined RGB value into its individual r,g,b components.
down:
rgb_ratio = neo.getpixel(0) 'get the r,g,b values of first pixel
neo.strip 0,npixels-1,neo.dim(rgb_ratio, 0.8) 'adjust brightness only if able to maintain the same colour ratios
return
up:
rgb_ratio = neo.getpixel(0) 'get the r,g,b values of first pixel
neo.strip 0,npixels-1,neo.dim(rgb_ratio, 1.2) 'adjust brightness only if able to maintain the same colour ratios
return
I see that SHIFT moves pixels along until they drop off the end, whereas ROTATE wraps them back around.
Are there any examples of NEO.BILINEARBLEND anywhere ?
NEO.DIM is handy, but of course once the r,g,b ratio can no longer be maintained it turns into a colour changer.
To act just as a dimmer requires preventing any further value changes that would cause any r,g,b value to become less than 0 or greater than 255, but NEO.DIM does not have any such optional limit.
Which means the r,g,b values need to be monitored to ensure they do not exceed limits. But all the NEO functions return a single combined RGB value, not the individual r,g,b components... so perhaps NEO.GETPIXEL might optionally be able to return the 3 individual r,g,b values.
Or something like a NEO.SPLIT function might be generally more useful for splitting a single combined RGB value into its individual r,g,b components.
down:
rgb_ratio = neo.getpixel(0) 'get the r,g,b values of first pixel
neo.strip 0,npixels-1,neo.dim(rgb_ratio, 0.8) 'adjust brightness only if able to maintain the same colour ratios
return
up:
rgb_ratio = neo.getpixel(0) 'get the r,g,b values of first pixel
neo.strip 0,npixels-1,neo.dim(rgb_ratio, 1.2) 'adjust brightness only if able to maintain the same colour ratios
return
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
Re: NEO.SHIFT
Look at this example here :[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jan 10, 2023 2:00 pm
Are there any examples of NEO.BILINEARBLEND anywhere ?
https://wokwi.com/projects/353567578278594561
- Electroguard
- Posts: 867
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 278 times
- Been thanked: 324 times
Re: NEO.SHIFT
Thanks for that - hah, was like watching a magic trick right ... can see it happening, but not sure what or how (is probably the trigonometry causing blurred vision).
Got me thinking though, might be an idea to create a forum topic where links to all the available Annex Wokwi Demos can be kept for anyone to browse through at any time, without even needing any hardware.
Got me thinking though, might be an idea to create a forum topic where links to all the available Annex Wokwi Demos can be kept for anyone to browse through at any time, without even needing any hardware.