how do I limit the display to only display the first four characters of the parameter to level enough space for the value?

Hi, I am not entirely new to arduino or OSC, but I am very much at the modifying scripts stage and slowing working things out. So any help is great appreciated

I am using a 128x128 tft screen.

Looking at the script the parameter OSC field is used for OSC and for the display.

This is great when it comes to Pan,Tilt, Zoom etc but becomes a mess once I get beyond 4 characters.

is there a way to limit the number of characters displayed, so Diff of Diffusion.

Alternatively could the labelling be done so that the display is separate to the parameter? so Gobo_Wheel_1 is Go 1 and GoR 1 for example?

  • Which code base did you use? Which board?

  • Hi sstaub,

    Using arduino nano (clone)

    the sketch is this -

    What I have done is basically the same as this with a modified pcb to connect up a different TFT screen, with a slightly different pinout. I have a couple and the only changes I have made so far are changing which parameters I am wanting to control and in the case of one (I am making 2) I had to rotate the screen 180 as the two tft's are clearly oriented differently on the controller board.

    Building it as a improvement on my current controller which is a stock Lighthack Box1 on a uno.

    Also I have seen but can't find again a complete list of EOS OSC parameters, if you old point me at that too that would be great.

    Thanks in advance


  • The problem is that all the "String", TFT, OSC library will consume too much RAM. Try to use another microcontroller like Raspberry Pi Pico (with the Earl E. Philhower Arduino Core and OSC library from the master branch).

  • It seems to work for the 6 parameters so far.

    What will actually happen?

  • The problem is the defragmentation of the RAM, so you need much more than the 2k which the Nano has.

  • There are several ways to deal with this but all of them are going to require a better processor than a nano.  You can build a table of parameter names to look for and then change the display bases on that but it is going to eat up ram as sstaub has pointed out.  There isn't a complete list of parameters readily available.  If you look in the CIA you can see a what parameters are in the patched fixtures but it won't be all the possible parameters.  I would suggest just dealing with the parameters you need and change the code in the  future when necessary.  There are some ways to make text scroll so you could include the entire parameter name but those will also eat up ram.  

  • If you are storing the incoming attribute name in a character array then you can truncate the array after the 4th caracter and display that.

  • HI Druuka, is there an example of that in your sketches?

  • Understood. I am pretty sure I came across quite a lot of documentation of OSC and EOS.

    Ultimately I am not looking to access everything, just interested in what was accessible. 2 pages of 3 works fine for me if I am honest. its more important to keep the unit compact, going through page after page would be far from ideal. The original Box1 work fine, but just having control of edge, zoom and iris would be nice, this leaves me with a spare position so logically diffusion seemed to be the obvious candidate.

    One simple workaround for me is to simply take diffusion out and replace it with CTO which would work with the display restrictions.

    I will look into the pico for the next build.

  • Is it not already built in to the script, to display a different parameter label.

    struct Parameter {
    String name;
    String display;
    float value;
    float lastDisplayed;
    const uint8_t PARAMETER_MAX = 6;
    struct Parameter parameter[PARAMETER_MAX] =
    // {"empty", "--"},

    the part after the comma in the {

    emtpy being displayed as -- in that example?

    Looking through your modifiation sstaub eg

    {"thrust_A", "ThrustA"},

    Is that not what that does, use thrust_A as the OSC parameter but display ThrustA to the display?