TD-Neopixel ring - brightness control issue (values)

hello everyone:) first post here

I have an arduino uno board, connected to an “adafruit neopixel ring NEO_RGBW + NEO_LHZ800” and the board is successfully connected to my patch.
I want to achieve: the ring is off, with a pulse from keyboard-in the brightness increases from 0 to 255 and then the ring stays on.

I’m having the following issue: the brightness in my level top increases from 0 to 1 (not from 0 to 255 values) so the ring is lagging and I cannot control it properly.
I think one issue is that the input of the brightness is not an integer (because it is raising from 0 to 1) and something else that Im doing wrong ahah

I tried to use a math chop to transform the range of the input from 0-1 to 0-255 but it is not working.

set up:
I used the circle TOP as a colour base, the LEVE controls the brightness that is the input in my RAMP (state0)
the Timer increase the values for the brightness and hold the value to 255 > select CHOP for the timer fraction > null connected to the brightness

Are you able to share your .toe file so we can see the processing that is going on throughout the file?

Are you able to elaborate on what the ‘lagging’ is? And how are you connecting to your Arduino? And can you explain how the Arduino is processing the incoming data from Touch?

An issue you might be facing is that your TOP cannot hold a range greater than 0-1. If you’re using TOPs and you need values greater than 0-1 you might want to switch to using 16 or 32-bit floats. To do this, click on your Circle TOP, head to the Common tab and switch the pixel format to 16-bit float (RGBA) or 32-bit float (RGBA). Basically this increases the range and accuracy and values your TOPs can hold.

I’ve attached a screenshot that demonstrates multiplying my TOP by 255 by using a Math TOP. In the 8-bit example it only reads 1, but in the 16-bit example it reads 255.

Hope this helps!

neopixelstatemachine.toe (9.4 KB)

Thank you for your help Jaydos!!

the lagging means that when I press the keyboard in to switch the correct animation I see delay in the ring turning on/animation showing up
and the brightness augments in steps and not gradually.

If it is stepping, it might be because you’re not sending the data quick enough. I see in your setup you are using an LFO CHOP to trigger the Serial DAT. Although this works, it is only sending the data when it triggers - this may be causing the stepping animation.

You might want to increase the frequency of the LFO - the quicker it’s triggering is the quicker the data is being sent to the data. Try a value like 8 or 16. (if you have issues with sending data at a higher rate might need to up your ‘Baud rate’ in your Arduino DAT and Arduino code to something like 115200).

Unfortunately I can’t test this as I don’t have any Neopixel’s on hand but it should help.

Let me know if this helps or if you have any other issues!

with LFO frequency 8 and baud rate 57600 is working! the responsw is much quicker, but only with the white colour
if I my input is a red circle the results is a flicker of different colours (also if I lower the LFO frequency to 1)
I think this colour issue is something related to the baud rate and the adafruit

I’m not on a device that can open the TouchDesigner file again at the moment, but it may be communications related between Touch and the Arduino. I would suggest setting up some lines in your Arduino code that prints out values section-by-section or line-by-line (Serial.println) to ensure you are receiving the expected values. If anything stands out then it may lead you to finding the answer. If all the values are correct/as expected, then you know that it is either the Arduino code or a hardware issue. If the values aren’t as expected, then it would be a Touch-to-Arduino issue or Touch issue alone.

You may need to set your LFO to a lower frequency (1 or even lower) so there’s enough time to print out and read the values as they are processed.