Typical T_19 - definition of slots

32 views
Skip to first unread message

Niels

unread,
Jul 20, 2020, 10:21:05 AM7/20/20
to souliss
Hi there all together

I just ran into a slot problem with typical T_19 which gave me some headache - maybe one of you guys can see an easy explanation for this.....


So far, I got a basically running program (testwise!) using two of T_19 typicals for LED-strips on a single node. So good so far. Therefore I know, the program itself on Arduino Mega runs technically correct without failure. Checked.

I would expect for T_19 (as determined, requires 2 slots each!) a code like this for slots should work:

#define LEDCUBE1              0               // This is the T_19 memory slot for the logic that handle LED-Cube_1
#define LEDCUBE1bright      1               // This is the memory slot for the logic that handle LED-Cube_1 brightness
#define LEDCUBE2              2               // This is the T_19 memory slot for the logic that handle LED-Cube_2
#define LEDCUBE2bright      3               // This is the memory slot for the logic that handle LED-Cube_2 brightness

Nevertheless, this won't work. Although both T_19 typicals (on slots 0 and 2) have been assigned with 2 slots each.

Control-problems via mobileApp on the above:
The LED on slot 2 will not start, IF LED on slot0 is activated prior to this one. LED on Slot 2 will only start if activeted first. Then I can toggle on LED on slot0. Nevertheless, if typical on slot0 has been activated, typical on slot2 is frozen and cannot be manipuated anymore untill typical on slot0 has been toggled off again.


IF I use a code like this, the program & App-controls run smoothly without failure...:
#define LEDCUBE1              0               // This is the T_19 memory slot for the logic that handle LED-Cube_1
#define LEDCUBE1bright      1               // This is the memory slot for the logic that handle LED-Cube_1 brightness
#define LEDCUBE2              3               // This is the T_19 memory slot for the logic that handle LED-Cube_2
#define LEDCUBE2bright      4               // This is the memory slot for the logic that handle LED-Cube_2 brightness

But here I'mI missing slot2 - and I will need the capacity for as much slots as possible for additional LED-controls.

Did I get some particulars wrong ?!

Maybe you can share some thoughts about what could be the problem (of course I can also add some more code lines - this was just the minimal basic problem I could focus on to describe the failure...)


Many thanks in advance, Niels

Fulvio Spelta

unread,
Jul 21, 2020, 3:15:47 AM7/21/20
to souliss
You should post all the code.

Niels

unread,
Jul 27, 2020, 12:24:02 PM7/27/20
to souliss
Here comes the code - this is an actual, basic running example on Arduino Mega of what I got so far....

I just like to get the idea. It would not let me use slots 2 and 5 and having full funtionality of the defined typicals - it's weired:


// Configure the framework
#include "souliss-7.2-friariello.1\bconf\StandardArduino.h"       
#include "souliss-7.2-friariello.1\conf\usart.h"

           // Wifi network communication via ESP8266-01 - working smooth & fine.
#define USARTDRIVER_INSKETCH
#define USART_TXENABLE 1
#define USART_TXENPIN  0
#define USARTDRIVER Serial


// Include framework code and libraries
#include <SPI.h>
#include "Souliss.h"

// There are not used in this sketch, keep it just to pat the compiler
#include <EEPROM.h>
#include <SoftwareSerial.h>


// This identify the number of the LED logic

#define LEDCUBE1              0               // This is the memory slot for the logic that handle Cube_1
#define LEDCUBE1count      1               // This is the memory slot for the logic that handle Cube_1 counter

#define LEDCUBE2              3               // This is the memory slot for the logic that handle Cube_1
#define LEDCUBE2count      4               // This is the memory slot for the logic that handle Cube_2 counter

#define LEDBOARD              6               // This is the memory slot for the logic that handle onboard LED pin13
#define LEDBOARDcount      7               // This is the memory slot for the logic that handle onboard LED counter

 
void setup()
{  
    Initialize();

   // Set network parameters
   SetAddress(0xD002, 0xFF00, 0xD001);

Set_T19(LEDCUBE1);                     // Set a logic to control a single colour LED Cube_1
    pinMode(10, OUTPUT);                // Power the LED Cube_1 on Arduino PWM-Slot1_10

Set_T19(LEDCUBE2);                      // Set a logic to control a single colour LED strip
    pinMode(11, OUTPUT);                // Power the LED Cube_1 on Arduino PWM-Slot1_11

Set_T19(LEDBOARD);                     // Set a logic to control a single colour LED strip
    pinMode(13, OUTPUT);                // Power the onboard LED on Arduino PWM-Slot1_13
}

void loop()
{
      // Here we start to play
    EXECUTEFAST() {                    
        UPDATEFAST();  

        FAST_10ms() {
       
// Use the output values to control LEDCUBE1

            Logic_T19(LEDCUBE1);

            if(mOutput(LEDCUBE1)){
                                    mInput(LEDCUBE1count+1) = 100; //brightness
                                    mInput(LEDCUBE1count)= Souliss_T1n_Set;
                                 }
         // Use the output values to control LEDCUBE_1
            analogWrite(10, mOutput(LEDCUBE1count));

// Use the output values to control LEDCUBE2
               
            Logic_T19(LEDCUBE2);

            if(mOutput(LEDCUBE2)){
                                    mInput(LEDCUBE2count+1) = 100; //brightness
                                    mInput(LEDCUBE2count)= Souliss_T1n_Set;
                                   }

         // Use the output values to control LEDCUBE_2
            analogWrite(11, mOutput(LEDCUBE2count));

 // Execute the logic that handle the Arduino onboard LED
          
            Logic_T19(LEDBOARD);
            //Logic_T14(LEDBOARD);

            if(mOutput(LEDBOARD)){
                                    mInput(LEDBOARDcount+1) = 100; //brightness
                                    mInput(LEDBOARDcount)= Souliss_T1n_Set;
                                   }

         // Use the output values to control onboard LED
            analogWrite(13, mOutput(LEDBOARDcount));
      

         // Just process communication as fast as the logics
            ProcessCommunication();
        }          
    }
 
  //EXECUTESLOW()
     EXECUTEFAST()
    {  
        UPDATEFAST();

        SLOW_10s()  {
       
        }    
    }      
}

Niels

unread,
Jul 27, 2020, 12:24:55 PM7/27/20
to souliss
Here we go - pls. find below...

Fulvio Spelta

unread,
Jul 28, 2020, 6:15:26 AM7/28/20
to souliss
#define LEDCUBE1              0               // This is the memory slot for the logic that handle Cube_1
#define LEDCUBE1count      1               // This is the memory slot for the logic that handle Cube_1 counter

#define LEDCUBE2              3               // This is the memory slot for the logic that handle Cube_1
#define LEDCUBE2count      4               // This is the memory slot for the logic that handle Cube_2 counter


mInput
(LEDCUBE1count+1) = 100; //brightness



the mInput is modifying the byte number 2

Niels

unread,
Jul 28, 2020, 5:50:50 PM7/28/20
to souliss
Dear Fulvio

Many thanks for support - sometimes, it just need a little push in the right direction..!

Looking at this now from the perspective you gave, it becomes very clear.

PROBLEM SOLVED -



Best regards....
Reply all
Reply to author
Forward
0 new messages