arkadiusz binder 5 năm trước cách đây
mục cha
commit
01f8074878
22 tập tin đã thay đổi với 2876 bổ sung1 xóa
  1. 311 0
      SE/stuff/P5_Automation_can-dev-res/LCD1602.h
  2. 387 0
      SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino
  3. 665 0
      SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev.graphml
  4. BIN
      SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev.numbers
  5. 22 0
      SE/stuff/P5_Automation_can-dev-res/TFT_ILI9163C.h
  6. 8 0
      SE/stuff/P5_Automation_can-dev-res/_ControllerID_loop1.h
  7. 459 0
      SE/stuff/P5_Automation_can-dev-res/_PCINT-dev.h
  8. 50 0
      SE/stuff/P5_Automation_can-dev-res/_PCINT.h
  9. 0 0
      SE/stuff/P5_Automation_can-dev-res/_PCINT_func.h
  10. 48 0
      SE/stuff/P5_Automation_can-dev-res/_PCINT_loop.h
  11. 11 0
      SE/stuff/P5_Automation_can-dev-res/_PCINT_setup.h
  12. 25 0
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW.h
  13. 8 0
      SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW_setup.h
  14. 83 0
      SE/stuff/P5_Automation_can-dev-res/_SlaveID_loop1.h
  15. 17 0
      SE/stuff/P5_Automation_can-dev-res/_SlaveID_setup.h
  16. 639 0
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports.h
  17. 46 0
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_LOCAL.h
  18. 32 0
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Protocol_CAN.h
  19. 41 0
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_func.h
  20. 19 0
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_queue_task_type_LIST.h
  21. 3 0
      SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_ttl_decrement.h
  22. 2 1
      SE/stuff/P5_Automation_can-dev/_SlaveID_loop1.h

+ 311 - 0
SE/stuff/P5_Automation_can-dev-res/LCD1602.h

@@ -0,0 +1,311 @@
+                            
+
+Queue<int> _LCD_print_queue = Queue<int>(5);
+
+
+
+ 
+ struct _LCD_print_bufforS {
+  int screenID;
+  int cursor1;
+  int cursor2;
+ int character ;
+ long time_seq_id;
+ long time_min_run;
+} ;
+
+typedef struct _LCD_print_bufforS _LCD_print_bufforT;
+
+//struct LCDarray1S {
+//   char LCDarray1[16];
+//}
+
+struct _LCD_print_screenS {
+  int screenID;
+  char LCDarray1;
+  char LCDarray2;
+   long time_seq_id;
+   long time_min_run;
+  // _LCD_print_bufforT ;
+} ;
+
+
+typedef struct _LCD_print_screenS _LCD_print_screensT;
+
+
+//_LCD_print_buffor _LCD_print_buffors[] = {  0 , 0, "T", 10000, 50000 } ;
+
+//_LCD_print_screen _LCD_print_screens[] = { 1 , _LCD_print_buffors } ;
+
+
+//void LCD_print_background_add( int[], int , int , int , char  ,long , long  ) ;
+
+ _LCD_print_bufforT _LCD_print_buffors[1];
+ _LCD_print_screensT _LCD_print_screens[10];
+
+
+
+void LCD_print_background_add(_LCD_print_bufforT* _LCD_print_buffors, int screenID, int cursor1, int cursor2, char character ,long time_seq_id, long time_min_run ) {
+  //time_seq_id - used to maintain single display context
+  //time_max - used to how much time to keep in displayed text
+ // Serial.println("  runned LCD_print_background_screen_add bbuf:  ");
+     // Serial.print(sizeof(_LCD_print_buffors));
+       Serial.print("CB:");
+      int curr_buf_ind;
+      int i ;
+       for(i=1;i<=100;i++) {
+          if(_LCD_print_buffors[i].screenID<=0) {
+            Serial.print("i<=0[");   Serial.print(i);   Serial.print("]");  
+            curr_buf_ind = i; 
+            //if(_LCD_print_buffors[i + 1].screenID<=0)
+            break;
+          }
+       }
+              Serial.print(curr_buf_ind);   Serial.print(".  ");
+//char b = character.charAt(0); 
+   Serial.print(" added lcd buf at ind "); Serial.println(curr_buf_ind );
+   int b_ascii_value = character;
+_LCD_print_buffors[curr_buf_ind] = { screenID , cursor1 , cursor2, b_ascii_value, time_seq_id , time_min_run} ;
+/*
+     _LCD_print_buffors[screenID].screenID=screenID ;
+     _LCD_print_buffors[screenID].cursor1=cursor1 ;
+     _LCD_print_buffors[screenID].cursor2=cursor2 ;
+     _LCD_print_buffors[screenID].character=b_ascii_value ;
+     _LCD_print_buffors[screenID].time_seq_id=time_seq_id ;
+     _LCD_print_buffors[screenID].time_min_run=time_min_run ;
+     */
+}
+
+
+void LCD_print_background_screen_add(_LCD_print_screensT* _LCD_print_screens, int screenID,long time_seq_id, long time_min_run, char LCDarray1, char LCDarray2 ) {
+  //time_seq_id - used to maintain single display context
+  //time_max - used to how much time to keep in displayed text
+  
+     _LCD_print_screens[screenID].screenID=screenID ;
+     _LCD_print_screens[screenID].time_seq_id=time_seq_id ;
+     _LCD_print_screens[screenID].time_min_run=time_min_run ;
+     _LCD_print_screens[screenID].LCDarray1=LCDarray1 ;
+     _LCD_print_screens[screenID].LCDarray2=LCDarray2 ;
+   Serial.print(" added to screen a1  "); Serial.println(String(LCDarray1) );
+ 
+    //  unsigned char LCDarray2buf[16];
+    //   LCDarray2.toCharArray(LCDarray2buf, 15);
+  /*
+                                     for ( int positionCounter1 = 0;
+                                        positionCounter1 < 24; positionCounter1++)
+                                            {
+                                              LCD_print_background_add( _LCD_print_buffors,            screenID,           positionCounter1,           0,              LCDarray1[positionCounter1],              time_seq_id,              time_min_run);
+                                              Serial.print("A.");
+                                            }
+                                         
+                                     for ( int positionCounter2 = 0;
+                                        positionCounter2 < 24; positionCounter2++)
+                                            {
+                                            LCD_print_background_add( _LCD_print_buffors,            screenID,           positionCounter2,           1,              LCDarray2[positionCounter2],              time_seq_id,              time_min_run);
+                                            }
+         Serial.print(" :");
+        Serial.print(sizeof(_LCD_print_buffors));
+       Serial.print(" :");
+       */
+}
+
+
+//  _LCD_print_bufforT  _LCD_print_bufforss[] = {  0 , 0, "T", 10000, 50000 } ;
+
+
+void LCD_print_background(int cursor1, int cursor2, int character ,long time_seq_id, long time_min_run ) {
+  //time_seq_id - used to maintain single display context
+  //time_max - used to how much time to keep in displayed text
+}
+
+
+ 
+
+void _LCD_print_screens_list(_LCD_print_screensT* _LCD_print_screens ) {
+ int i;
+
+
+   Serial.print("sizeof(_LCD_print_screens): ");
+    Serial.println(sizeof(_LCD_print_screens));
+ for(i=0;i<=10;i++) { //sizeof(_LCD_print_buffors)
+          Serial.print(" $i[");
+          Serial.print(i);
+
+          Serial.print("] screenID: ");
+          Serial.print(_LCD_print_screens[i].screenID);
+
+
+           String str((char*) _LCD_print_screens[i].LCDarray1);
+
+          Serial.print(" LCDarray1 ph: ");
+          Serial.println( str);
+
+
+          Serial.print(" LCDarray1 len: ");
+          Serial.println( sizeof(str));
+         
+         
+          Serial.print(" LCDarray1: ");
+          Serial.println( Serial.println((char*) _LCD_print_screens[i].LCDarray1) );
+     
+           Serial.print(" LCDarray2: ");
+          Serial.write(_LCD_print_screens[i].LCDarray2);
+
+           Serial.print(" time_seq_id: ");
+           
+          Serial.write( _LCD_print_screens[i].time_seq_id );
+          
+
+       
+           Serial.print(" time_seq_id: ");
+          Serial.println(_LCD_print_screens[i].time_seq_id);
+
+        
+
+      
+        }
+      
+}
+
+
+void _LCD_print_buffors_list(_LCD_print_bufforT* _LCD_print_buffors, int LCDtim ) {
+ int i;
+   Serial.print("sizeof(_LCD_print_buffors): ");
+    Serial.println(sizeof(_LCD_print_buffors));
+ for(i=0;i<=100;i++) { //sizeof(_LCD_print_buffors)
+          Serial.print(" $i[");
+          Serial.print(i);
+
+          Serial.print("] _LCD_print_buffors screenID: ");
+          Serial.print(_LCD_print_buffors[i].screenID);
+          
+          Serial.print(" cursor1: ");
+          Serial.print(_LCD_print_buffors[i].cursor1);
+           Serial.print(" cursor2: ");
+          Serial.print(_LCD_print_buffors[i].cursor2);
+
+           Serial.print(" character: ");
+           
+          Serial.write( _LCD_print_buffors[i].character );
+          
+
+       
+           Serial.print(" time_seq_id: ");
+          Serial.print(_LCD_print_buffors[i].time_seq_id);
+
+          Serial.print(" time_min_run: ");  
+          Serial.println(_LCD_print_buffors[i].time_min_run);
+
+      
+        }
+        lcd.setCursor(0,0); 
+       lcd.print("print_buffors");  // Print a message to the LCD.
+        lcd.setCursor(0,1); 
+         lcd.print(String( _LCD_print_buffors[0].character)); 
+          lcd.print(" , "); 
+           lcd.print(String( _LCD_print_buffors[1].character)); 
+         delay(LCDtim * 5);
+}
+
+void LCD_print(String LCDarray1, String LCDarray2 ,int LCDtim) {
+
+      delay(LCDtim);   
+      unsigned char LCDarray1buf[16];
+      LCDarray1.toCharArray(LCDarray1buf, 16);
+ 
+      unsigned char LCDarray2buf[16];
+       LCDarray2.toCharArray(LCDarray2buf, 16);
+
+     // lcd.setCursor(0,0); 
+     // lcd.print(LCDarray1);
+     // lcd.setCursor(0,1); 
+     // lcd.print(LCDarray1);
+
+                                        lcd.setCursor(16,0); 
+ 
+                                         for ( int positionCounter1 = 0;
+                                        positionCounter1 <= 24 ;//LCDarray1.length(); // 24;
+                                        positionCounter1++)
+                                            {
+                                              lcd.scrollDisplayLeft();  //Scrolls the contents of the display one space to the left.
+                                              if(positionCounter1 >= LCDarray1.length())  lcd.print(" ");
+                                              else lcd.print(LCDarray1[positionCounter1]);  // Print a message to the LCD.
+                                              delay(LCDtim);  //wait for 250 microseconds
+                                              if(positionCounter1==10) delay(LCDtim *7 ); 
+                                            }
+                                          //  lcd.clear();  //Clears the LCD screen and positions the cursor in the upper-left corner.
+
+
+
+
+                                          
+                                          lcd.setCursor(16,1); 
+                                         for ( int positionCounter2 = 0;
+                                        positionCounter2 <= 24;//LCDarray2.length();//24; 
+                                        positionCounter2++)
+                                            {
+                                              lcd.scrollDisplayLeft();  //Scrolls the contents of the display one space to the left.
+                                              if(positionCounter2 >= LCDarray2.length())  lcd.print(" "); 
+                                              else lcd.print(LCDarray2[positionCounter2]);  // Print a message to the LCD.
+                                              delay(LCDtim);  //wait for 250 microseconds
+                                               if(positionCounter2==10) delay(LCDtim *7 );
+                                            }
+                                            delay(LCDtim  * 5);  //wait for 250 microseconds
+                                          //  lcd.clear();  //Clears the LCD screen and positions the cursor in the upper-left corner.
+                                           
+
+      
+      delay(LCDtim);   
+
+      
+
+/*
+
+struct record
+{
+   int bookId;
+   int qtyInStock;
+
+};
+typedef struct record Record;
+
+void sold(int id, Record* records) {
+  int i;
+  for(i=0;i<3;i++) {
+    if(records[i].bookId == id) {
+      records[i].qtyInStock--;
+    }
+  }
+}
+*/
+/*
+void updateId(int id, int new_id, Record* records) {
+  int i;
+  for(i=0;i<3;i++) {
+    if(records[i].bookId == id) {
+        records[i].bookid = new_id;
+    }
+  }
+}
+*/
+/*
+void updateQty(int id, int new_qty, Record* records) {
+  int i;
+  for(i=0;i<3;i++) {
+    if(records[i].bookId == id) {
+        records[i].qtyInStock = new_qty;
+    }
+  }
+}
+*/
+
+
+}           
+                            
+String make_str16(String str){
+    for(int i = 0; i < (16 - str.length()); i++)
+        str += ' ';  
+    return str;
+}
+                
+                                      

+ 387 - 0
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev-res.ino

@@ -0,0 +1,387 @@
+/* P5_Automation_can-dev
+ * 2020-06 testing communications CAN for integrate further with Procesy5
+ * A.Binder
+ * Uses: 
+ * LCD1602 - big 2x16 character display
+ * TFT_ILI9163C 128x128 lcd display
+ * MCP_2515 - can port controller
+ * 
+ * controls
+ * Slave ports via:     
+ * I2C      
+ * PCA9685 - 16port 12bit PWM driver - can controll 16 eg. LEDs which can be 0....12V dimmed=]                
+ * todo 74HC595 - Serial to Parallel Shifting-Out - from 8 ports to many if connected in paraller
+ *       based on https://www.arduino.cc/en/tutorial/ShiftOut 
+ * or 16 servos               
+ * - can have addressed many of PCA9685 on I2C bus - so can controll over 64 ports      
+ * to be added another devices tested
+ * todo Rottary Swich { GND, +, SW, DT, CLK } - to provide LCD menu access
+
+ *  TODO structure of port is in _Slave_Ports.h  
+ *     _Slave_Port _Slave_Ports[] = {
+        {"CAN", 0x102, 0x80, 0x00, 0, 0x00, 0x00 },
+        {"CAN",  - Base port origin protocol
+          0x102,  - Base port origin protocol address
+           0x80, -  int PortTypes;  0xFF  =  1111 1111
+                                    0x01  =  0000 0001  = PWM port
+                                    {
+                                      bit 1 - PWM port
+                                      bit 2 - not allocated
+                                      bit 3 - not allocated
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    },
+            0x00, int Address -  local address on e.g. I2C bus - 0x40 etc                     
+            0x00, - int LocalPort - local port number when used e.g. I2C extension
+             0x01 - Exp_state -     0xFF  =  1111 1111
+                                    0x00  =  0000 0000  = OFF = 0V
+                                    0x01  =  0000 0001  = ON = PWM max
+                                              {
+                                                bit 1 - OFF = 0V
+                                                bit 2 - ON = PWM max
+                                                bit 3 - not allocated
+                                                bit 4 - not allocated
+                                                bit 2 - not allocated
+                                                bit 5 - not allocated
+                                                bit 6 - not allocated
+                                                bit 7 - not allocated
+                                                bit 8 - not allocated
+                                              }, 
+               0x6d - testowy ttl - 10 sekund do przedawnienia stanu portu w tablicy i koniecznosci odswiezenia tablicy
+               } 
+        };
+        - to be optimalized for inegration
+        - to allow of subscribe ports
+        - to allow of concurent routing
+        - to allow new port detectioj
+        - to allow creating ports dependencies e.g. IF 
+            - port has value
+            - port AND port 
+            THEN
+            - set port
+           - probably should be avilable creations of virtual ports which would describe 
+            - state of port AND port etc... 
+ *  TO BE INTEGRATED WITH p5 
+ *    - interface and WFST
+ *  TO BE INGEGRATED WITH MARLIN 3D PRINTERS - machine and automation purpose
+ *    - controll remote ports via g-code 
+ *    - allows interrupts
+ *   TO ALLOW OF NEXT PACKETS TYPES WITH DIFFERENT MEANINGS
+ *    - dimming
+ *    logic
+ */
+
+
+#include "Queue.h"
+ 
+ Queue<int> _Slave_Ports_queue = Queue<int>(10);
+
+ 
+
+
+#define  _ControllerID   0x101 
+#define  _Slave1_ID   0x103 
+
+//#define Active_ControllerID _ControllerID 
+#define Active_ControllerID _Slave1_ID 
+
+
+ #if Active_ControllerID == _ControllerID 
+    String lcdPattern = "s" ;
+    #define HAS_LCD1602 
+   //  #define HAS_TFT_ILI9163C 
+   #define HAS_ROTTARY_SW
+ #endif
+ #if Active_ControllerID == _Slave1_ID 
+    String lcdPattern = "." ;
+    #define HAS_TFT_ILI9163C 
+   // #define HAS_LCD1602 
+ #endif
+
+//BEGIN 1602
+#if defined(HAS_LCD1602)
+  #include <LiquidCrystal.h>
+  // initialize the library with the numbers of the interface pins
+  //LiquidCrystal lcd(4, 6, 10, 11, 12, 13);
+  //LiquidCrystal lcd(4, 6, 53, 51, 50, 52  );
+  const int LCD1602rs=12, LCD1602en=11, LCD1602db4=5, LCD1602db5=4, LCD1602db6=3, LCD1602db7=2; // lcd keypad shield pins
+  LiquidCrystal lcd(LCD1602rs, LCD1602en, LCD1602db4, LCD1602db5, LCD1602db6, LCD1602db7);
+  int lcdPos = 0 ;
+  #include "LCD1602.h"
+#endif
+
+
+#if defined(HAS_TFT_ILI9163C)
+
+  #include <SPI.h>
+  #include <Adafruit_GFX.h>
+  #include <TFT_ILI9163C.h>
+  #include "TFT_ILI9163C.h"
+
+#endif
+
+
+
+//BEGIN CAN
+
+
+#include <mcp_can.h>
+#include <SPI.h>
+
+long unsigned int CANrxId;
+unsigned char CANlen = 0;
+unsigned char CANrxBuf[8];
+const int CAN_CSpin = 53 , CAN_INTpin = 10 ;
+MCP_CAN CAN0(CAN_CSpin);                          // Set CS to pin 10
+//EOF CAN
+
+
+
+
+
+ //REMOTE PORTS DEFINITIONS
+
+  #include "_Slave_Ports.h"
+  // #define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 } 
+   //#define _CAN_P_0x102_PWMServoDriver0x40
+   
+    // #define   Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver();
+  //    Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
+
+
+// #define __CSpin 53 // 10 //  chip select
+ 
+ 
+ 
+ int LCDtim = 250;  //the value of delay time
+
+
+
+
+
+
+
+  
+
+#if defined(HAS_ROTTARY_SW)
+ #include "_ROTTARY_SW.h"
+#endif
+// include the library code
+/**********************************************************/
+//EOF BEGIN 1602
+
+
+#include "_PCINT.h"
+
+
+void setup() {
+    Serial.begin(115200);
+// _LCD_print_queue.push(1);
+// _LCD_print_queue.push(2);
+// _LCD_print_queue.push(3);
+
+//String character = "Geas";
+//char b = abc.charAt(0); 
+//int b_ascii_value = b;
+
+ // LCD_print_background_add( _LCD_print_buffors,            0,           0,           0,              "W",              5000,              6000);
+ // LCD_print_background_add( _LCD_print_buffors,            1,           0,           0,              "H",              5000,              6000);
+ // LCD_print_background_add( _LCD_print_buffors,            2,           0,           0,              "W",              5000,              6000);
+ // LCD_print_background_add( _LCD_print_buffors,            3,           0,           0,              "K",              5000,              6000);
+
+ 
+//todo PCINT service
+#include "_PCINT_setup.h"
+
+
+
+#if defined(HAS_ROTTARY_SW)
+ #include "_ROTTARY_SW_setup.h"
+#endif
+
+
+
+ String LCDarray1="CAN_1602_LCD           ";  //the string to print onthe LCD
+ String LCDarray2="Testing id   ";  //the string to print onthe LCD
+ LCDarray2.concat(String(Active_ControllerID, HEX) ) ;
+ 
+
+  
+  // put your setup code here, to run once:
+  #if defined(HAS_LCD1602)
+  lcd.begin(16, 2);
+     LCD_print(LCDarray1, LCDarray2, LCDtim/5);
+  #endif
+
+  #if defined(HAS_TFT_ILI9163C)
+
+  
+ TFT_ILI9163C display = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
+  float p = 3.1415926;
+     display.begin();
+     display.clearScreen();
+     display.setCursor(0,0);
+     display.print(LCDarray1);
+     display.setCursor(0,10);
+     display.print(LCDarray2);
+     delay(LCDtim); 
+  #endif
+
+  //BEGIN CAN
+ 
+  //if(CAN0.begin(MCP_STDEXT, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
+  if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
+     LCDarray1="MCP2515 Init Okay";
+     LCDarray2="500KBPS 16MHZ";
+   Serial.print(LCDarray1 + LCDarray2);
+    #if defined(HAS_LCD1602)
+      LCD_print(LCDarray1, LCDarray2, LCDtim/5);
+    #endif
+    #if defined(HAS_TFT_ILI9163C)
+      delay(LCDtim);  
+      display.setCursor(0,20); 
+      display.print("MCP2515 Init Okay!!\r\n");
+      delay(LCDtim); 
+    #endif
+  } else { 
+     LCDarray1 = "MCP2515 Init Failed";
+     LCDarray2 = "CAN_CSpin: "; 
+     LCDarray2.concat(CAN_CSpin);  
+     LCDarray2.concat("CAN_INTpin: ");
+     LCDarray2.concat(CAN_INTpin);    
+    Serial.print(LCDarray1);
+      #if defined(HAS_LCD1602)
+          LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
+      #endif
+      #if defined(HAS_TFT_ILI9163C)
+        delay(LCDtim);  
+        display.setCursor(0,20); 
+        display.print(LCDarray1);
+        delay(LCDtim); 
+         display.setCursor(0,50); 
+         display.print(LCDarray2);
+         delay(LCDtim); 
+      #endif
+  }
+
+
+       #if Active_ControllerID == _Slave1_ID 
+        #include "_SlaveID_setup.h"
+       #elif Active_ControllerID == _ControllerID
+          LCDarray1 = "Master Module       ";
+          LCDarray2 = "enabling remotes        ";
+       #endif
+        Serial.println("");
+         #if defined(HAS_LCD1602)
+          LCD_print(LCDarray1, LCDarray2, LCDtim / 5 ) ;
+          delay(LCDtim * 10); 
+         #endif
+         #if defined(HAS_TFT_ILI9163C)
+          delay(LCDtim);  
+          display.setCursor(0,30); 
+          display.print(LCDarray1); display.print(" ");
+          display.print(LCDarray2);
+
+          delay(LCDtim); 
+         #endif
+        CAN0.setMode(MCP_NORMAL);                // Change to normal mode to allow messages to be transmitted
+        pinMode(CAN_INTpin, INPUT);                       // Setting pin 2 for /INT input
+
+  //EOF CAN
+   #if defined(HAS_LCD1602) 
+      LCDarray1 = "loop.... ";
+      LCDarray2 = "....";
+     LCD_print(LCDarray1, LCDarray2, LCDtim/10);
+     
+    #endif
+
+
+//_Slave_Ports_queue.push(_LCD_print_queue.peek() + 1);
+ Serial.println("#298 _Slave_Ports_queue__list");
+ _Slave_Ports_queue__INIT(_Slave_Ports_queue_tasks_LIST);
+_Slave_Ports_queue__list(_Slave_Ports_queue_tasks_LIST);
+  int _Slave_Ports_queue_peek =  _Slave_Ports_queue.peek() ;
+//  int _Slave_Ports_queue_push = _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1) ; 
+  //int _Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ; _Slave_Ports_queue__add(  *_Slave_Ports_queue_tasks_LIST, 0x01 ,0x00 ,100, 5000 ) ;  // _Slave_Ports_queue_peek, _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1), _Slave_Ports_queue.peek());
+//void _Slave_Ports_queue__add( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST,int _Slave_Ports_queue_task_type,int _Slave_Port_link,long time_seq_id, long time_min_run //, 
+_Slave_Ports_queue__add(     _Slave_Ports_queue_tasks_LIST,  int(0x04) ,0x00 ,100, 5000 ) ;  //        "_Slave_Ports_broadcast", //4
+_Slave_Ports_queue__add(  _Slave_Ports_queue_tasks_LIST, 0x05 ,0x00 ,100, 5000 ) ;  //"_Slave_Ports_set_I2C" //5  - to set ports associated on PW
+
+ //  _Slave_Ports_queue_peek =  _Slave_Ports_queue.peek() ; 
+   //_Slave_Ports_queue_push =  _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1) ;  
+   //_Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ; 
+//_Slave_Ports_queue__add(  _Slave_Ports_queue_tasks_LIST, 0x02 ,0x00 ,100, 5000, _Slave_Ports_queue_peek, _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1), _Slave_Ports_queue.peek());
+//   _Slave_Ports_queue_peek =  _Slave_Ports_queue.peek() ; 
+   //_Slave_Ports_queue_push =  _Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1) ; 
+  // _Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ; 
+//_Slave_Ports_queue__add(  _Slave_Ports_queue_tasks_LIST, 0x03 ,0x00 ,100, 5000, _Slave_Ports_queue_peek, 
+//_Slave_Ports_queue.push(_Slave_Ports_queue.peek() + 1),
+//_Slave_Ports_queue.peek());
+
+ Serial.println("#301 _Slave_Ports_queue__list");
+_Slave_Ports_queue__list(_Slave_Ports_queue_tasks_LIST);
+Serial.print("#304 _Slave_Ports_queue.count(), "); Serial.println(_Slave_Ports_queue.count());
+  
+   
+ //  _Slave_Ports_queue__add(  _Slave_Ports_queue_tasks_LIST, 0x03 ,0x00 ,100, 5000 ) ;  
+ //Serial.println("#323 _Slave_Ports_queue__list"); _Slave_Ports_queue__list(_Slave_Ports_queue_tasks_LIST);
+// Serial.print("#324 _Slave_Ports_queue.count(), "); Serial.println(_Slave_Ports_queue.count());
+
+}
+
+    //#if Active_ControllerID == _ControllerID
+     // byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
+    //#endif
+
+  //String LCDarray1 ;
+  //String LCDarray2 ;
+
+
+  unsigned long time;
+  
+
+
+void loop() {
+ 
+  #include "_PCINT_loop.h"
+
+  time = millis();
+  Serial.print("Time: " );
+  Serial.println(time);
+  // put your main code here, to run repeatedly:
+  //BEGIN CAN
+   
+   #if Active_ControllerID == _Slave1_ID
+      #include "_SlaveID_loop1.h"
+    #elif Active_ControllerID == _ControllerID
+         #include "_ControllerID_loop1.h"
+         
+    #endif
+  
+  
+  _Slave_Ports_queue__list(_Slave_Ports_queue_tasks_LIST) ;
+  int _Slave_Ports_queue_count = _Slave_Ports_queue.count();
+  int _Slave_Ports_queue_front = _Slave_Ports_queue.front();
+  int _Slave_Ports_queue_back =  _Slave_Ports_queue.back();
+  int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek();
+  int _Slave_Ports_queue_pop = _Slave_Ports_queue.pop();
+ _Slave_Ports_queue__POP( _Slave_Ports_queue_tasks_LIST, 
+ _Slave_Ports_queue_count, 
+ _Slave_Ports_queue_pop, 
+ _Slave_Ports_queue_front, 
+ _Slave_Ports_queue_back,
+ _Slave_Ports_queue_peek,
+ LCDtim, _Slave_Ports);
+
+  //_LCD_print_buffors_list(_LCD_print_buffors) ;
+  //_LCD_print_screens_list(_LCD_print_screens);
+}
+
+
+
+#include "_PCINT_func.h"
+#include "_Slave_Ports_func.h"

+ 665 - 0
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev.graphml

@@ -0,0 +1,665 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
+  <!--Created by yEd 3.18.1-->
+  <key attr.name="Description" attr.type="string" for="graph" id="d0"/>
+  <key for="port" id="d1" yfiles.type="portgraphics"/>
+  <key for="port" id="d2" yfiles.type="portgeometry"/>
+  <key for="port" id="d3" yfiles.type="portuserdata"/>
+  <key attr.name="url" attr.type="string" for="node" id="d4"/>
+  <key attr.name="description" attr.type="string" for="node" id="d5"/>
+  <key for="node" id="d6" yfiles.type="nodegraphics"/>
+  <key for="graphml" id="d7" yfiles.type="resources"/>
+  <key attr.name="url" attr.type="string" for="edge" id="d8"/>
+  <key attr.name="description" attr.type="string" for="edge" id="d9"/>
+  <key for="edge" id="d10" yfiles.type="edgegraphics"/>
+  <graph edgedefault="directed" id="G">
+    <data key="d0"/>
+    <node id="n0" yfiles.foldertype="group">
+      <data key="d4" xml:space="preserve"/>
+      <data key="d5"/>
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="64.0" width="155.0" x="877.0" y="558.0"/>
+              <y:Fill color="#F2F0D8" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#B7B69E" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="155.0" x="0.0" xml:space="preserve" y="0.0">1602_LCD</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+              <y:DropShadow color="#D2D2D2" offsetX="4" offsetY="4"/>
+              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="50.0" width="50.0" x="927.0" y="181.0"/>
+              <y:Fill color="#F2F0D8" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#B7B69E" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">3</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+              <y:DropShadow color="#D2D2D2" offsetX="4" offsetY="4"/>
+              <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n0:"/>
+    </node>
+    <node id="n1" yfiles.foldertype="group">
+      <data key="d4" xml:space="preserve"/>
+      <data key="d5"/>
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="134.666015625" width="123.0" x="704.0" y="558.0"/>
+              <y:Fill color="#F2F0D8" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#B7B69E" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="123.0" x="0.0" xml:space="preserve" y="0.0">ATMEGA</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+              <y:DropShadow color="#D2D2D2" offsetX="4" offsetY="4"/>
+              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="1" leftF="1.0" right="1" rightF="1.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="50.0" width="50.0" x="156.0" y="163.0"/>
+              <y:Fill color="#F2F0D8" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#B7B69E" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">3</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+              <y:DropShadow color="#D2D2D2" offsetX="4" offsetY="4"/>
+              <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n1:">
+        <node id="n1::n0" yfiles.foldertype="group">
+          <data key="d4" xml:space="preserve"/>
+          <data key="d5"/>
+          <data key="d6">
+            <y:ProxyAutoBoundsNode>
+              <y:Realizers active="0">
+                <y:GroupNode>
+                  <y:Geometry height="83.0" width="91.0" x="720.0" y="594.666015625"/>
+                  <y:Fill color="#CAECFF84" transparent="false"/>
+                  <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="91.0" x="0.0" xml:space="preserve" y="0.0">_PCINT</y:NodeLabel>
+                  <y:Shape type="roundrectangle"/>
+                  <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+                  <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+                  <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+                </y:GroupNode>
+                <y:GroupNode>
+                  <y:Geometry height="50.0" width="50.0" x="262.0" y="261.0"/>
+                  <y:Fill color="#CAECFF84" transparent="false"/>
+                  <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+                  <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">2</y:NodeLabel>
+                  <y:Shape type="roundrectangle"/>
+                  <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+                  <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+                  <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+                </y:GroupNode>
+              </y:Realizers>
+            </y:ProxyAutoBoundsNode>
+          </data>
+          <graph edgedefault="directed" id="n1::n0:"/>
+        </node>
+      </graph>
+    </node>
+    <node id="n2" yfiles.foldertype="group">
+      <data key="d4" xml:space="preserve"/>
+      <data key="d5"/>
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="171.0" width="208.0" x="450.0" y="558.0"/>
+              <y:Fill color="#CAECFF84" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="208.0" x="0.0" xml:space="preserve" y="0.0">_Slave_Ports[]</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="false" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="50.0" width="50.0" x="145.0" y="606.0"/>
+              <y:Fill color="#CAECFF84" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="50.0" x="0.0" xml:space="preserve" y="0.0">2</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="true" closedHeight="50.0" closedWidth="50.0" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n2:"/>
+    </node>
+    <node id="n3" yfiles.foldertype="group">
+      <data key="d5"/>
+      <data key="d6">
+        <y:TableNode configuration="YED_TABLE_NODE">
+          <y:Geometry height="512.0859375" width="202.0" x="362.0" y="0.0"/>
+          <y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="102.47412109375" x="49.762939453125" xml:space="preserve" y="4.0">_Slave_Ports[]</y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="57.759765625" x="3.0" xml:space="preserve" y="38.1201171875">_Protocol<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="57.900390625" x="3.0" xml:space="preserve" y="101.3212890625">_Slave_ID<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="56.798828125" x="3.0" xml:space="preserve" y="154.4150390625">New Row<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_2" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="56.798828125" x="3.0" xml:space="preserve" y="205.6865234375">New Row<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_3" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="56.798828125" x="3.0" xml:space="preserve" y="255.6865234375">New Row<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_4" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="56.798828125" x="3.0" xml:space="preserve" y="382.1865234375">New Row<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_5" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:StyleProperties>
+            <y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
+            <y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.rows"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
+          </y:StyleProperties>
+          <y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
+          <y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:BorderInsets bottom="385" bottomF="384.953125" left="15" leftF="15.0" right="15" rightF="15.0" top="79" topF="79.0"/>
+          <y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
+            <y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+            <y:DefaultRowInsets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+            <y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
+            <y:Columns>
+              <y:Column id="column_0" minimumWidth="80.0" width="80.0">
+                <y:Insets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+              </y:Column>
+            </y:Columns>
+            <y:Rows>
+              <y:Row height="74.0" id="row_0" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="52.54296875" id="row_1" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="52.54296875" id="row_2" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="50.0" id="row_3" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="50.0" id="row_4" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="203.0" id="row_5" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+            </y:Rows>
+          </y:Table>
+        </y:TableNode>
+      </data>
+      <graph edgedefault="directed" id="n3:">
+        <node id="n3::n0">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="148.0" x="401.0" y="110.56640625"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="57.900390625" x="45.0498046875" xml:space="preserve" y="-1.56640625">_Slave_ID<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <node id="n4" yfiles.foldertype="group">
+      <data key="d5"/>
+      <data key="d6">
+        <y:TableNode configuration="YED_TABLE_NODE">
+          <y:Geometry height="512.0859375" width="316.0" x="0.0" y="0.0"/>
+          <y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="268.6826171875" x="23.65869140625" xml:space="preserve" y="4.0">_Slave_Ports_queue_task_type_LIST[]</y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.587890625" x="3.0" xml:space="preserve" y="73.2060546875">0<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.587890625" x="3.0" xml:space="preserve" y="124.4775390625">1<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.587890625" x="3.0" xml:space="preserve" y="177.0205078125">2<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_2" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.587890625" x="3.0" xml:space="preserve" y="228.2919921875">3<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_3" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.587890625" x="3.0" xml:space="preserve" y="278.2919921875">4<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_4" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="11.587890625" x="3.0" xml:space="preserve" y="404.7919921875">5<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_5" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="25.4921875" x="51.25390625" xml:space="preserve" y="33.0">hex<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_0" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="30.501953125" x="128.7490234375" xml:space="preserve" y="33.0">desc<y:LabelModel><y:ColumnNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:ColumnNodeLabelModelParameter id="column_1" inside="true" verticalPosition="0.0"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" hasText="false" height="4.0" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="4.0" x="156.0" y="254.04296875">
+            <y:LabelModel>
+              <y:SmartNodeLabelModel distance="4.0"/>
+            </y:LabelModel>
+            <y:ModelParameter>
+              <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
+            </y:ModelParameter>
+          </y:NodeLabel>
+          <y:StyleProperties>
+            <y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
+            <y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.rows"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
+          </y:StyleProperties>
+          <y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
+          <y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:BorderInsets bottom="180" bottomF="179.8671875" left="15" leftF="15.0" right="15" rightF="15.0" top="5" topF="5.0"/>
+          <y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
+            <y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
+            <y:DefaultRowInsets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+            <y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
+            <y:Columns>
+              <y:Column id="column_0" minimumWidth="80.0" width="80.0">
+                <y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
+              </y:Column>
+              <y:Column id="column_1" minimumWidth="80.0" width="80.0">
+                <y:Insets bottom="0.0" left="0.0" right="0.0" top="24.0"/>
+              </y:Column>
+            </y:Columns>
+            <y:Rows>
+              <y:Row height="50.0" id="row_0" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="52.54296875" id="row_1" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="52.54296875" id="row_2" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="50.0" id="row_3" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="50.0" id="row_4" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="203.0" id="row_5" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+            </y:Rows>
+          </y:Table>
+        </y:TableNode>
+      </data>
+      <graph edgedefault="directed" id="n4:">
+        <node id="n4::n0">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="22.0" width="48.0" x="39.0" y="59.0"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.123046875" x="6.9384765625" xml:space="preserve" y="1.93359375">0x00<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n1">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="22.0" width="48.0" x="39.0" y="109.0"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.123046875" x="6.9384765625" xml:space="preserve" y="1.93359375">0x01<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n2">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="48.0" x="39.0" y="163.109375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.123046875" x="6.9384765625" xml:space="preserve" y="-1.56640625">0x02<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n3">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="48.0" x="39.0" y="215.65234375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.123046875" x="6.9384765625" xml:space="preserve" y="-1.56640625">0x03<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n4">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="48.0" x="39.0" y="265.65234375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.123046875" x="6.9384765625" xml:space="preserve" y="-1.56640625">0x04<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n5">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="48.0" x="39.0" y="315.65234375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="34.123046875" x="6.9384765625" xml:space="preserve" y="-1.56640625">0x05<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n6">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="104.0" x="119.0" y="62.5"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="72.044921875" x="15.9775390625" xml:space="preserve" y="-1.56640625">_NOT_USED<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n7">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="182.0" x="119.0" y="112.5"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="161.224609375" x="10.3876953125" xml:space="preserve" y="-1.56640625">_Slave_Ports_ttl_decrement<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n8">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="182.0" x="119.0" y="163.109375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="160.66796875" x="10.666015625" xml:space="preserve" y="-1.56640625">request_confirm_Exp_state<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n9">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="182.0" x="119.0" y="215.65234375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="162.37890625" x="9.810546875" xml:space="preserve" y="-1.56640625">request_set_new_Exp_state<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n10">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="182.0" x="119.0" y="265.65234375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="138.3671875" x="21.81640625" xml:space="preserve" y="-1.56640625">_Slave_Ports_broadcast<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n4::n11">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="15.0" width="182.0" x="119.0" y="315.65234375"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="123.61328125" x="29.193359375" xml:space="preserve" y="-1.56640625">_Slave_Ports_set_I2C<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <node id="n5" yfiles.foldertype="group">
+      <data key="d5"/>
+      <data key="d6">
+        <y:TableNode configuration="YED_TABLE_NODE">
+          <y:Geometry height="512.0859375" width="104.0" x="0.0" y="558.0"/>
+          <y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="101.69775390625" x="1.151123046875" xml:space="preserve" y="4.0">ROTTARY_SW</y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="42.54296875" x="3.0" xml:space="preserve" y="45.728515625">Lane 0<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="42.54296875" x="3.0" xml:space="preserve" y="286.771484375">Lane 1<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:StyleProperties>
+            <y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
+            <y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.rows"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
+          </y:StyleProperties>
+          <y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
+          <y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
+            <y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+            <y:DefaultRowInsets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+            <y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
+            <y:Columns>
+              <y:Column id="column_0" minimumWidth="80.0" width="80.0">
+                <y:Insets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+              </y:Column>
+            </y:Columns>
+            <y:Rows>
+              <y:Row height="74.0" id="row_0" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="408.0859375" id="row_1" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+            </y:Rows>
+          </y:Table>
+        </y:TableNode>
+      </data>
+      <graph edgedefault="directed" id="n5:"/>
+    </node>
+    <node id="n6" yfiles.foldertype="group">
+      <data key="d5"/>
+      <data key="d6">
+        <y:TableNode configuration="YED_TABLE_NODE">
+          <y:Geometry height="512.0859375" width="104.0" x="150.0" y="558.0"/>
+          <y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="103.47021484375" x="0.264892578125" xml:space="preserve" y="4.0">TFT_ILI9163C</y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="35.76953125" x="3.0" xml:space="preserve" y="49.115234375">L0,L1<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="35.76953125" x="3.0" xml:space="preserve" y="290.158203125">L2,L3<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:StyleProperties>
+            <y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
+            <y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.rows"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
+          </y:StyleProperties>
+          <y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
+          <y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
+            <y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+            <y:DefaultRowInsets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+            <y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
+            <y:Columns>
+              <y:Column id="column_0" minimumWidth="80.0" width="80.0">
+                <y:Insets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+              </y:Column>
+            </y:Columns>
+            <y:Rows>
+              <y:Row height="74.0" id="row_0" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="408.0859375" id="row_1" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+            </y:Rows>
+          </y:Table>
+        </y:TableNode>
+      </data>
+      <graph edgedefault="directed" id="n6:"/>
+    </node>
+    <node id="n7" yfiles.foldertype="group">
+      <data key="d5"/>
+      <data key="d6">
+        <y:TableNode configuration="YED_TABLE_NODE">
+          <y:Geometry height="512.0859375" width="104.0" x="300.0" y="558.0"/>
+          <y:Fill color="#ECF5FF" color2="#0042F440" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="79.05126953125" x="12.474365234375" xml:space="preserve" y="4.0">1602_LCD</y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="17.986328125" x="3.0" xml:space="preserve" y="58.0068359375">L0<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="17.986328125" x="3.0" xml:space="preserve" y="299.0498046875">L1<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:StyleProperties>
+            <y:Property class="java.awt.Color" name="yed.table.section.color" value="#7192b2"/>
+            <y:Property class="java.lang.Double" name="yed.table.header.height" value="24.0"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.main" value="#c4d7ed"/>
+            <y:Property class="java.awt.Color" name="yed.table.lane.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.alternating" value="#abc8e2"/>
+            <y:Property class="java.lang.String" name="yed.table.lane.style" value="lane.style.rows"/>
+            <y:Property class="java.awt.Color" name="yed.table.header.color.main" value="#c4d7ed"/>
+          </y:StyleProperties>
+          <y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
+          <y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:Table autoResizeTable="true" defaultColumnWidth="120.0" defaultMinimumColumnWidth="80.0" defaultMinimumRowHeight="50.0" defaultRowHeight="80.0">
+            <y:DefaultColumnInsets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+            <y:DefaultRowInsets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+            <y:Insets bottom="0.0" left="0.0" right="0.0" top="30.0"/>
+            <y:Columns>
+              <y:Column id="column_0" minimumWidth="80.0" width="80.0">
+                <y:Insets bottom="0.0" left="0.0" right="0.0" top="0.0"/>
+              </y:Column>
+            </y:Columns>
+            <y:Rows>
+              <y:Row height="74.0" id="row_0" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+              <y:Row height="408.0859375" id="row_1" minimumHeight="50.0">
+                <y:Insets bottom="0.0" left="24.0" right="0.0" top="0.0"/>
+              </y:Row>
+            </y:Rows>
+          </y:Table>
+        </y:TableNode>
+      </data>
+      <graph edgedefault="directed" id="n7:"/>
+    </node>
+    <node id="n8" yfiles.foldertype="group">
+      <data key="d5"/>
+      <data key="d6">
+        <y:TableNode configuration="com.yworks.bpmn.Pool">
+          <y:Geometry height="512.0859375" width="181.62109375" x="834.37890625" y="0.0"/>
+          <y:Fill color="#FFF2BC" color2="#D4D4D4CC" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="21.666015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="l" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="147.4521484375" x="4.0" xml:space="preserve" y="182.31689453125">_CAN_MSG_STRUCT</y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="57.900390625" x="33.0" xml:space="preserve" y="33.0498046875">_Slave_ID<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_0" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="42.54296875" x="33.0" xml:space="preserve" y="109.0">Lane 2<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_1" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="42.54296875" x="33.0" xml:space="preserve" y="161.54296875">Lane 3<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_2" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="56.798828125" x="33.0" xml:space="preserve" y="205.6865234375">New Row<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_3" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" rotationAngle="270.0" textColor="#000000" verticalTextPosition="bottom" visible="true" width="56.798828125" x="33.0" xml:space="preserve" y="355.6865234375">New Row<y:LabelModel><y:RowNodeLabelModel offset="3.0"/></y:LabelModel><y:ModelParameter><y:RowNodeLabelModelParameter horizontalPosition="0.0" id="row_4" inside="true"/></y:ModelParameter></y:NodeLabel>
+          <y:StyleProperties>
+            <y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_ROW_STYLE">
+              <y:SimpleStyle fillColor="#474A4340" lineColor="#000000" lineType="line" lineWidth="1.0"/>
+            </y:Property>
+            <y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.line.color" value="#000000"/>
+            <y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_COLUMN_SELECTION_STYLE">
+              <y:SimpleStyle fillColor="#474A4380" lineColor="#000000" lineType="line" lineWidth="3.0"/>
+            </y:Property>
+            <y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_ROW_SELECTION_STYLE">
+              <y:SimpleStyle fillColor="#474A4380" lineColor="#000000" lineType="line" lineWidth="3.0"/>
+            </y:Property>
+            <y:Property class="java.awt.Color" name="POOL_LANE_COLOR_ALTERNATING" value="#ffffff"/>
+            <y:Property class="java.awt.Color" name="POOL_LANE_COLOR_MAIN" value="#ffffff"/>
+            <y:Property class="java.lang.String" name="POOL_LANE_STYLE" value="LANE_STYLE_COLUMNS"/>
+            <y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill2" value="#d4d4d4cc"/>
+            <y:Property class="java.awt.Color" name="com.yworks.bpmn.icon.fill" value="#ffffffe6"/>
+            <y:Property class="com.yworks.yfiles.bpmn.view.BPMNTypeEnum" name="com.yworks.bpmn.type" value="POOL_TYPE_LANE"/>
+            <y:Property name="y.view.tabular.TableNodePainter.ALTERNATE_COLUMN_STYLE">
+              <y:SimpleStyle fillColor="#474A4340" lineColor="#000000" lineType="line" lineWidth="1.0"/>
+            </y:Property>
+          </y:StyleProperties>
+          <y:State autoResize="true" closed="false" closedHeight="80.0" closedWidth="100.0"/>
+          <y:Insets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+          <y:BorderInsets bottom="318" bottomF="317.54296875" left="30" leftF="29.62109375" right="0" rightF="0.0" top="142" topF="141.54296875"/>
+          <y:Table autoResizeTable="true" defaultColumnWidth="360.0" defaultMinimumColumnWidth="30.0" defaultMinimumRowHeight="30.0" defaultRowHeight="107.0">
+            <y:DefaultColumnInsets bottom="3.0" left="3.0" right="3.0" top="20.0"/>
+            <y:DefaultRowInsets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
+            <y:Insets bottom="0.0" left="30.0" right="0.0" top="0.0"/>
+            <y:Columns>
+              <y:Column id="column_0" minimumWidth="30.0" width="128.62109375">
+                <y:Insets bottom="3.0" left="3.0" right="3.0" top="20.0"/>
+              </y:Column>
+            </y:Columns>
+            <y:Rows>
+              <y:Row height="84.0" id="row_0" minimumHeight="52.54296875">
+                <y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
+              </y:Row>
+              <y:Row height="52.54296875" id="row_1" minimumHeight="52.54296875">
+                <y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
+              </y:Row>
+              <y:Row height="52.54296875" id="row_2" minimumHeight="52.54296875">
+                <y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
+              </y:Row>
+              <y:Row height="50.0" id="row_3" minimumHeight="30.0">
+                <y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
+              </y:Row>
+              <y:Row height="250.0" id="row_4" minimumHeight="30.0">
+                <y:Insets bottom="3.0" left="20.0" right="3.0" top="3.0"/>
+              </y:Row>
+            </y:Rows>
+          </y:Table>
+        </y:TableNode>
+      </data>
+      <graph edgedefault="directed" id="n8:">
+        <node id="n8::n0">
+          <data key="d5"/>
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="30.0" width="99.0" x="914.0" y="161.54296875"/>
+              <y:Fill color="#FFCC00" transparent="false"/>
+              <y:BorderStyle color="#000000" raised="false" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="59.2421875" x="19.87890625" xml:space="preserve" y="5.93359375">task_type<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
+              <y:Shape type="hexagon"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <edge id="e0" source="n4" target="n8::n0">
+      <data key="d9"/>
+      <data key="d10">
+        <y:PolyLineEdge>
+          <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0"/>
+          <y:LineStyle color="#000000" type="line" width="1.0"/>
+          <y:Arrows source="none" target="standard"/>
+          <y:BendStyle smoothed="false"/>
+        </y:PolyLineEdge>
+      </data>
+    </edge>
+  </graph>
+  <data key="d7">
+    <y:Resources/>
+  </data>
+</graphml>

BIN
SE/stuff/P5_Automation_can-dev-res/P5_Automation_can-dev.numbers


+ 22 - 0
SE/stuff/P5_Automation_can-dev-res/TFT_ILI9163C.h

@@ -0,0 +1,22 @@
+  //#define TFT_ILI9163C_CSpin __CSpin // 53 // 10 //  chip select
+  #define TFT_ILI9163C_CSpin 7 // __CSpin // 53 // 10 //  chip select
+
+  #define TFT_ILI9163C_DCpin 8 // A0   data/command pin.   sometimes called DC, RS, ...
+
+  #define TFT_ILI9163C__RSTpin 9 //reset pin.   you must connect.   (or pullup)
+  //#define __SDA 51 //11 //+ bidirectional data pin.   Connect to MOSI
+  //#define __SCK 52 //13 //+ clock.   sometimes called SCLK, SCL, ...
+
+  
+  // Color definitions
+  #define BLACK   0x0000
+  #define BLUE    0x001F
+  #define RED     0xF800
+  #define GREEN   0x07E0
+  #define CYAN    0x07FF
+  #define MAGENTA 0xF81F
+  #define YELLOW  0xFFE0  
+  #define WHITE   0xFFFF
+
+ // TFT_ILI9163C display = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
+ // float p = 3.1415926;

+ 8 - 0
SE/stuff/P5_Automation_can-dev-res/_ControllerID_loop1.h

@@ -0,0 +1,8 @@
+// send data:  ID = 0x100, Standard CAN Frame, Data length = 8 bytes, 'data' = array of data bytes to send
+          //byte sndStat = CAN0.sendMsgBuf(0x100, 0, 8, data);
+         
+          
+          
+     
+          
+        

+ 459 - 0
SE/stuff/P5_Automation_can-dev-res/_PCINT-dev.h

@@ -0,0 +1,459 @@
+/*
+attachInterrupt(digitalPinToInterrupt(pin), ISR, mode) (recommended)
+attachInterrupt(interrupt, ISR, mode) (not recommended)
+attachInterrupt(pin, ISR, mode) (Not recommended. Additionally, this syntax only works on Arduino SAMD Boards, Uno WiFi Rev2, Due, and 101.)
+
+
+Parameters
+interrupt: the number of the interrupt. Allowed data types: int.
+pin: the Arduino pin number.
+ISR: the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine.
+mode: defines when the interrupt should be triggered. Four constants are predefined as valid values:
+
+LOW to trigger the interrupt whenever the pin is low,
+
+CHANGE to trigger the interrupt whenever the pin changes value
+
+RISING to trigger when the pin goes from low to high,
+
+FALLING for when the pin goes from high to low.
+
+The Due, Zero and MKR1000 boards allow also:
+
+HIGH to trigger the interrupt whenever the pin is high.
+
+
+
+
+onst byte ledPin = 13;
+const byte interruptPin = 2;
+volatile byte state = LOW;
+
+void setup() {
+  pinMode(ledPin, OUTPUT);
+  pinMode(interruptPin, INPUT_PULLUP);
+  attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
+}
+
+void loop() {
+  digitalWrite(ledPin, state);
+}
+
+void blink() {
+  state = !state;
+}
+
+
+
+
+
+BOARD               INT.0         INT.1         INT.2       INT.3         INT.4         INT.5
+Uno, Ethernet         2             3
+Mega2560              2             3            21          20             19            18
+32u4 based (e.g 
+Leonardo, Micro)      3             2             0           1             7
+
+*/
+
+
+/*
+ *
+ 
+ http://arduinowo.pl/przerwania-typu-pcint-klawiatura/
+ http://arduinowo.pl/generatory/pin_int/
+
+ 
+ 
+ */
+
+
+ 
+ // FOR ATMEGA
+   
+//  void setup ()
+
+  #include <avr/interrupt.h> 
+
+  #define   sei()
+  #define   cli()
+
+ // Macros for writing interrupt handler functions
+#define   ISR(vector, attributes)
+#define   SIGNAL(vector)
+#define   EMPTY_INTERRUPT(vector)
+#define   ISR_ALIAS(vector, target_vector)
+#define   reti() 
+#define   BADISR_vect
+
+
+//ISR attributes
+#define   ISR_BLOCK
+#define   ISR_NOBLOCK
+#define   ISR_NAKED
+#define   ISR_ALIASOF(target_vector)
+
+/*
+ Introduction to avr-libc's interrupt handling
+
+It's nearly impossible to find compilers that agree on how to handle interrupt code. Since the C language tries to stay away from machine dependent details, each compiler writer is forced to design their method of support.
+
+In the AVR-GCC environment, the vector table is predefined to point to interrupt routines with predetermined names. By using the appropriate name, your routine will be called when the corresponding interrupt occurs. The device library provides a set of default interrupt routines, which will get used if you don't define your own.
+
+Patching into the vector table is only one part of the problem. The compiler uses, by convention, a set of registers when it's normally executing compiler-generated code. It's important that these registers, as well as the status register, get saved and restored. The extra code needed to do this is enabled by tagging the interrupt function with __attribute__((signal)).
+
+These details seem to make interrupt routines a little messy, but all these details are handled by the Interrupt API. An interrupt routine is defined with ISR(). This macro register and mark the routine as an interrupt handler for the specified peripheral. The following is an example definition of a handler for the ADC interrupt.
+ */
+
+/*ISR(ADC_vect)
+{
+    // user code here
+}
+*/
+/*
+ Catch-all interrupt vector
+
+If an unexpected interrupt occurs (interrupt is enabled and no handler is installed, which usually indicates a bug), then the default action is to reset the device by jumping to the reset vector. You can override this by supplying a function named BADISR_vect which should be defined with ISR() as such. (The name BADISR_vect is actually an alias for __vector_default. The latter must be used inside assembly code in case <avr/interrupt.h> is not included.)
+
+//#include <avr/interrupt.h>
+*/
+/*
+ISR(BADISR_vect)
+{
+    // user code here
+}
+ */
+
+/*Nested interrupts
+
+The AVR hardware clears the global interrupt flag in SREG before entering an interrupt vector. 
+Thus, normally interrupts will remain disabled inside the handler until the handler exits, where the RETI instruction
+(that is emitted by the compiler as part of the normal function epilogue for an interrupt handler) will eventually re-enable further interrupts. For that reason,
+interrupt handlers normally do not nest. For most interrupt handlers, this is the desired behaviour, for some it is even required in order to prevent infinitely 
+recursive interrupts (like UART interrupts, or level-triggered external interrupts). In rare circumstances though it might be desired to re-enable the global 
+interrupt flag as early as possible in the interrupt handler, in order to not defer any other interrupt more than absolutely needed. This could be done using an sei() 
+instruction right at the beginning of the interrupt handler, but this still leaves few instructions inside the compiler-generated function prologue to run with global
+interrupts disabled. The compiler can be instructed to insert an SEI instruction right at the beginning of an interrupt handler by declaring the handler the following way:
+
+*/
+
+ISR(PCINT0_vect, ISR_NOBLOCK)
+{
+ // ...
+}
+//where XXX_vect is the name of a valid interrupt vector for the MCU type in question, as explained below.
+
+/*
+Two vectors sharing the same code
+
+In some circumstances, the actions to be taken upon two different interrupts might be completely identical so a single implementation for the ISR would suffice. 
+For example, pin-change interrupts arriving from two different ports could logically signal an event that is independent from the actual port (and thus interrupt vector)
+where it happened. Sharing interrupt vector code can be accomplished using the ISR_ALIASOF() attribute to the ISR macro:
+*/
+/*
+ISR(PCINT0_vect)
+{
+
+  //...
+  // Code to handle the event.
+}
+
+ISR(PCINT1_vect, ISR_ALIASOF(PCINT0_vect));
+*/
+/*
+Note
+There is no body to the aliased ISR.
+Note that the ISR_ALIASOF() feature requires GCC 4.2 or above (or a patched version of GCC 4.1.x).
+See the documentation of the ISR_ALIAS() macro for an implementation which is less elegant but could be applied to all compiler versions.
+
+
+*/
+
+/*
+Empty interrupt service routines
+In rare circumstances, in interrupt vector does not need any code to be implemented at all. The vector must be declared anyway, so when the interrupt triggers it won't
+execute the BADISR_vect code (which by default restarts the application).
+
+This could for example be the case for interrupts that are solely enabled for the purpose of getting the controller out of sleep_mode().
+
+A handler for such an interrupt vector can be declared using the EMPTY_INTERRUPT() macro:
+
+*/
+  #define EMPTY_INTERRUPT  (   vector  ) 
+
+//  Note There is no body to this macro.
+
+
+
+/*
+Manually defined ISRs
+
+In some circumstances, the compiler-generated prologue and epilogue of the ISR might not be optimal for the job, and a manually defined ISR could be considered particularly to speedup the interrupt handling.
+
+One solution to this could be to implement the entire ISR as manual assembly code in a separate (assembly) file. See Combining C and assembly source files for an example of how to implement it that way.
+
+Another solution is to still implement the ISR in C language but take over the compiler's job of generating the prologue and epilogue. 
+This can be done using the ISR_NAKED attribute to the ISR() macro. Note that the compiler does not generate anything as prologue or epilogue,
+so the final reti() must be provided by the actual implementation. SREG must be manually saved if the ISR code modifies it, and the compiler-implied assumption 
+of __zero_reg__ always being 0 could be wrong (e. g. when interrupting right after of a MUL instruction).
+
+ISR(TIMER1_OVF_vect, ISR_NAKED)
+{
+  PORTB |= _BV(0);  // results in SBI which does not affect SREG
+  reti();
+}
+
+*/ 
+
+
+/*
+Choosing the vector: Interrupt vector names
+
+The interrupt is chosen by supplying one of the symbols in following table.
+
+There are currently two different styles present for naming the vectors. One form uses names starting with SIG_, followed by a relatively verbose but arbitrarily chosen name describing the interrupt vector. 
+This has been the only available style in avr-libc up to version 1.2.x.
+
+Starting with avr-libc version 1.4.0, a second style of interrupt vector names has been added, where a short phrase for the vector description is followed by _vect. 
+The short phrase matches the vector name as described in the datasheet of the respective device (and in Atmel's XML files), with spaces replaced by an underscore and other non-alphanumeric characters dropped. 
+Using the suffix _vect is intented to improve portability to other C compilers available for the AVR that use a similar naming convention.
+
+The historical naming style might become deprecated in a future release, so it is not recommended for new projects.
+
+Note
+being usable as an interrupt function, is not actually wired into the interrupt vector table. The compiler will generate a warning if it detects a suspiciously looking name of a ISR() 
+function (i.e. one that after macro replacement does not start with "__vector_").
+
+Vector name               Old vector name            Description                 Applicable for device
+ADC_vect                  SIG_ADC                    ADC Conversion Complete      AT90S2333, AT90S4433, AT90S4434, AT90S8535, AT90PWM216, AT90PWM2B, AT90PWM316, AT90PWM3B, AT90PWM3, AT90PWM2, AT90PWM1, AT90CAN128, AT90CAN32, AT90CAN64, ATmega103, ATmega128, ATmega1284P, ATmega16, ATmega163, ATmega165, ATmega165P, ATmega168P, ATmega169, ATmega169P, ATmega32, ATmega323, ATmega325, ATmega3250, ATmega3250P, ATmega328P, ATmega329, ATmega3290, ATmega3290P, ATmega48P, ATmega64, ATmega645, ATmega6450, ATmega649, ATmega6490, ATmega8, ATmega8535, ATmega88P, ATmega168, ATmega48, ATmega88, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega324P, ATmega164P, ATmega644P, ATmega644, ATtiny13, ATtiny15, ATtiny26, ATtiny43U, ATtiny48, ATtiny24, ATtiny44, ATtiny84, ATtiny45, ATtiny25, ATtiny85, ATtiny261, ATtiny461, ATtiny861, AT90USB1287, AT90USB1286, AT90USB647, AT90USB646
+
+ */
+
+char attributes;
+ 
+#define ISR  (   vector, attributes )   
+
+/*
+ Introduces an interrupt handler function (interrupt service routine) that runs with global interrupts initially disabled by default with no attributes specified.
+
+The attributes are optional and alter the behaviour and resultant generated code of the interrupt routine. Multiple attributes may be used for a single function, with a space seperating each attribute.
+
+Valid attributes are ISR_BLOCK, ISR_NOBLOCK, ISR_NAKED and ISR_ALIASOF(vect).
+
+vector must be one of the interrupt vector names that are valid for the particular MCU type.
+ */
+
+#define ISR_ALIAS  (   vector, target_vector  )   
+/*
+Aliases a given vector to another one in the same manner as the ISR_ALIASOF attribute for the ISR() macro. Unlike the ISR_ALIASOF attribute macro however, this is compatible for all versions of GCC rather than just GCC version 4.2 onwards.
+
+Note
+This macro creates a trampoline function for the aliased macro. This will result in a two cycle penalty for the aliased vector compared to the ISR the vector is aliased to, due to the JMP/RJMP opcode used.
+Deprecated:
+For new code, the use of ISR(..., ISR_ALIASOF(...)) is recommended.
+Example:
+
+    1 ISR(INT0_vect)
+    2 {
+    3     PORTB = 42;
+    4 }
+    5 
+    6 ISR_ALIAS(INT1_vect, INT0_vect);
+ */
+
+ #define ISR_ALIASOF (   target_vector ) 
+//The ISR is linked to another ISR, specified by the vect parameter. This is compatible with GCC 4.2 and greater only.
+//Use this attribute in the attributes parameter of the ISR macro.
+
+
+#define ISR_BLOCK
+
+/*
+ Identical to an ISR with no attributes specified. Global interrupts are initially disabled by the AVR hardware when entering the ISR, without the compiler modifying this state.
+Use this attribute in the attributes parameter of the ISR macro.
+ */
+
+ #define ISR_NAKED
+/*
+ ISR is created with no prologue or epilogue code. The user code is responsible for preservation of the machine state including the SREG register, as well as placing a reti() at the end of the interrupt routine.
+
+Use this attribute in the attributes parameter of the ISR macro.
+ */
+
+#define ISR_NOBLOCK
+/*
+ ISR runs with global interrupts initially enabled. The interrupt enable flag is activated by the compiler as early as possible within the ISR to ensure minimal processing delay for nested interrupts.
+
+This may be used to create nested ISRs, however care should be taken to avoid stack overflows, or to avoid infinitely entering the ISR for those cases where the AVR hardware does not clear the respective interrupt flag before entering the ISR.
+
+Use this attribute in the attributes parameter of the ISR macro.
+ */
+
+
+
+#define reti  (   ) 
+/*
+ Returns from an interrupt routine, enabling global interrupts. This should be the last command executed before leaving an ISR defined with the ISR_NAKED attribute.
+
+This macro actually compiles into a single line of assembly, so there is no function call overhead.
+ */
+
+
+#define sei  (   ) 
+/*
+ Enables interrupts by setting the global interrupt mask. This function actually compiles into a single line of assembly, so there is no function call overhead. However, the macro also implies a memory barrier which can cause additional loss of optimization.
+
+In order to implement atomic access to multi-byte objects, consider using the macros from <util/atomic.h>, rather than implementing them manually with cli() and sei().
+ */
+
+#define SIGNAL  (   vector  ) 
+/*
+ Introduces an interrupt handler function that runs with global interrupts initially disabled.
+
+This is the same as the ISR macro without optional attributes.
+
+Deprecated:
+Do not use SIGNAL() in new code. Use ISR() instead.
+ */
+
+
+  pinMode(ROTTARY_SW_sw, INPUT_PULLUP);
+  pinMode(ROTTARY_SW_dt, INPUT_PULLUP);
+  //Set PCIE0 to enable PCMSK0 scan.
+ /* 
+  PCICR |= (1 << PCIE0);
+  //Set PCINT0 (digital input 8) to trigger an interrupt on state change.
+  PCMSK0 |= (1 << PCINT10);   //Set PCINT0 (digital input 14) to trigger an interrupt on state change.
+  PCMSK0 |= (1 << PCINT9);  //Set PCINT0 (digital input 15) to trigger an interrupt on state change.
+  PCMSK0 |= (1 << PCINT4);  //Set PCINT0 (digital input 10) to trigger an interrupt on state change.
+  PCMSK0 |= (1 << PCINT5);  //Set PCINT0 (digital input 11) to trigger an interrupt on state change.
+  PCMSK0 |= (1 << PCINT6);  //Set PCINT0 (digital input 12) to trigger an interrupt on state change.
+  PCMSK0 |= (1 << PCINT7);  //Set PCINT0 (digital input 13) to trigger an interrupt on state change.
+  */  
+  /*
+  void loop ()
+{
+  channel_1 = map(receiver_input_channel_1, fromLow, fromHigh, toLow, toHigh);
+  channel_2 = map(receiver_input_channel_2, fromLow, fromHigh, toLow, toHigh);
+  channel_3 = map(receiver_input_channel_3, fromLow, fromHigh, toLow, toHigh);
+  channel_4 = map(receiver_input_channel_4, fromLow, fromHigh, toLow, toHigh);
+  channel_5 = map(receiver_input_channel_5, fromLow, fromHigh, toLow, toHigh);
+  channel_6 = map(receiver_input_channel_6, fromLow, fromHigh, toLow, toHigh);
+
+// debug
+  Serial.print("Channel 1 = ");
+  Serial.print(channel_1);
+  Serial.print('\t');
+  Serial.print("Channel 2 = ");
+  Serial.print(channel_2);
+  Serial.print('\t');
+  Serial.print("Channel 3 = ");
+  Serial.print(channel_3);
+  Serial.print('\t');
+  Serial.print("Channel 4 = ");
+  Serial.print(channel_4);
+  Serial.print('\t');
+  Serial.print("Channel 5 = ");
+  Serial.print(channel_5);
+  Serial.print('\t');
+  Serial.print("Channel 6 = ");
+  Serial.print(channel_6);
+  Serial.print('\n');
+
+}
+
+*/
+
+/*
+
+ISR(PCINT0_vect)
+{
+  current_time = micros();
+  //Channel 1=========================================
+  if(PINB & B00000001)
+  {                                        //Is input 8 high?
+  if(last_channel_1 == 0)
+  {                                   //Input 8 changed from 0 to 1
+    last_channel_1 = 1;                                      //Remember current input state
+    timer_1 = current_time;                                  //Set timer_1 to current_time
+  }
+  }
+  else if(last_channel_1 == 1)
+  {                                //Input 8 is not high and changed from 1 to 0
+    last_channel_1 = 0;                                        //Remember current input state
+    receiver_input_channel_1 = current_time - timer_1;         //Channel 1 is current_time - timer_1
+  }
+  //Channel 2=========================================
+  if(PINB & B00000010 )
+  {                                       //Is input 9 high?
+    if(last_channel_2 == 0)
+    {                                   //Input 9 changed from 0 to 1
+      last_channel_2 = 1;                                      //Remember current input state
+      timer_2 = current_time;                                  //Set timer_2 to current_time
+    }
+  }
+  else if(last_channel_2 == 1)
+  {                                //Input 9 is not high and changed from 1 to 0
+    last_channel_2 = 0;                                        //Remember current input state
+    receiver_input_channel_2 = current_time - timer_2;         //Channel 2 is current_time - timer_2
+  }
+  //Channel 3=========================================
+  if(PINB & B00000100 )
+  {                                       //Is input 10 high?
+    if(last_channel_3 == 0)
+    {                                   //Input 10 changed from 0 to 1
+      last_channel_3 = 1;                                      //Remember current input state
+      timer_3 = current_time;                                  //Set timer_3 to current_time
+    }
+  }
+  else if(last_channel_3 == 1)
+  {                                //Input 10 is not high and changed from 1 to 0
+    last_channel_3 = 0;                                        //Remember current input state
+    receiver_input_channel_3 = current_time - timer_3;         //Channel 3 is current_time - timer_3
+
+  }
+  //Channel 4=========================================
+  if(PINB & B00001000 )
+  {                                       //Is input 11 high?
+    if(last_channel_4 == 0)
+    {                                   //Input 11 changed from 0 to 1
+      last_channel_4 = 1;                                      //Remember current input state
+      timer_4 = current_time;                                  //Set timer_4 to current_time
+    }
+  }
+  else if(last_channel_4 == 1)
+  {                                //Input 11 is not high and changed from 1 to 0
+    last_channel_4 = 0;                                        //Remember current input state
+    receiver_input_channel_4 = current_time - timer_4;         //Channel 4 is current_time - timer_4
+  }
+  //Channel 5=========================================
+  if(PINB & B00010000)
+  {
+    if(last_channel_5 == 0)
+    {
+      last_channel_5 = 1;
+      timer_5 = current_time;        
+    }    
+  }
+  else if(last_channel_5 == 1)
+  {
+      last_channel_5 = 0;
+      receiver_input_channel_5 = current_time - timer_5;
+  }
+  //Channel 6=========================================
+  if(PINB & B00100000)
+  {
+    if(last_channel_6 == 0)
+    {
+      last_channel_6 = 1;
+      timer_6 = current_time;
+    }    
+  }
+  else if(last_channel_6 == 1)
+  {
+    last_channel_6 = 0;
+    receiver_input_channel_6 = current_time - timer_6;    
+  }
+}
+  
+*/
+  

+ 50 - 0
SE/stuff/P5_Automation_can-dev-res/_PCINT.h

@@ -0,0 +1,50 @@
+#include <PinChangeInt.h>
+
+// PIN NAMING
+// For the Analog Input pins used as digital input pins, you can call them 14, 15, 16, etc.
+// or you can use A0, A1, A2, etc. (the Arduino code will properly recognize the symbolic names,
+// for example, pinMode(A0, INPUT_PULLUP);
+
+// For Arduino MEGA (AT2560-based), besides the regular pins and the A (analog) pins,
+// you have 4 more pins with defined names:
+// SS   = 53
+// MOSI = 51
+// MISO = 50
+// SCK  = 52
+
+// NOW CHOOSE PINS
+#if ! ( defined __AVR_ATmega2560__ || defined __AVR_ATmega1280__ || defined __AVR_ATmega1281__ || defined __AVR_ATmega2561__ || defined __AVR_ATmega640__ )
+#error "This sketch only works on chips in the ATmega2560 family."
+#endif
+
+
+#define FIRST_ANALOG_PIN 54
+#define TOTAL_PINS 69 //97 // 69 // But only 18 of them (not including RX0) are PinChangeInt-compatible
+                      // Don't use RX0 (Arduino pin 0) in this program- it won't work this is the
+                      // pin that Serial.print() uses!
+// See the Arduino and the chip documentation for more details.
+#define MYPIN1 ROTTARY_SW_clk // ROTTARY_SW_sw // ROTTARY_SW_sw // SS
+#define MYPIN2 ROTTARY_SW_dt // SCK
+#define MYPIN3 ROTTARY_SW_sw  // A8 //ROTTARY_SW_sw // MOSI
+#define PIN3TEXT "ROTTARY_SW_sw " // This will say what MYPIN3 is, on the serial monitor
+
+volatile uint8_t latest_interrupted_pin;
+volatile uint8_t interrupt_count[TOTAL_PINS]={0}; // possible arduino pins
+volatile uint8_t pin3Count=0;
+
+
+// Do not use any Serial.print() in this function. Serial.print() uses interrupts, and is not compatible
+// with an interrupt routine...!
+void quicfunc() {
+  latest_interrupted_pin=PCintPort::arduinoPin;
+  interrupt_count[latest_interrupted_pin]++;
+};
+
+// You can assign any number of functions to different pins. How cool is that?
+void pin3func() {
+  pin3Count++;
+   Serial.println("pin3func TRIG");
+}
+
+uint8_t i;
+uint8_t currentPIN3Count=0;

+ 0 - 0
SE/stuff/P5_Automation_can-dev-res/_PCINT_func.h


+ 48 - 0
SE/stuff/P5_Automation_can-dev-res/_PCINT_loop.h

@@ -0,0 +1,48 @@
+/* uint8_t count;
+  Serial.print(".");
+  delay(1000);                                // every second,
+  for (i=0; i < TOTAL_PINS; i++) {
+    if (interrupt_count[i] != 0) {            // look at all the interrupted pins
+      count=interrupt_count[i];               // store its count since the last iteration
+      interrupt_count[i]=0;                   // and reset it to 0.
+      Serial.print("Count for pin ");
+      if (i == 50) { Serial.print("MISO"); }  // then tell the user what it was, in a friendly way.
+      else if (i == 51) { Serial.print("MOSI"); }
+      else if (i == 52) { Serial.print("SCK"); }
+      else if (i == 53) { Serial.print("SS"); }
+      else if (i < FIRST_ANALOG_PIN) {
+        Serial.print("D");
+        Serial.print(i, DEC);
+      } else {
+        Serial.print("A");
+        Serial.print(i-FIRST_ANALOG_PIN, DEC);
+      }
+      Serial.print(" is ");
+      Serial.println(count, DEC);
+    }
+  }
+  if (currentPIN3Count != pin3Count) {        // Print our monotonically increasing counter (no reset to 0)
+      Serial.print(PIN3TEXT);
+      Serial.print(" count update: "); Serial.print(pin3Count, DEC); Serial.println();
+      currentPIN3Count=pin3Count;
+  }
+
+  */
+/*
+ Serial.print("Port : A8 " );
+ Serial.print(A8);
+Serial.print(" digitalPinToPort(A8)::: " );
+ Serial.println( digitalPinToPort(A8));
+
+ 
+ Serial.print("Port : A9 " );
+ Serial.print(A9);
+Serial.print(" digitalPinToPort(A9)::: " );
+ Serial.println( digitalPinToPort(A9));
+
+ 
+ Serial.print("Port : A10 " );
+ Serial.print(A10);
+Serial.print(" digitalPinToPort(A10)::: " );
+ Serial.println( digitalPinToPort(A10));
+ */

+ 11 - 0
SE/stuff/P5_Automation_can-dev-res/_PCINT_setup.h

@@ -0,0 +1,11 @@
+/*  pinMode(MYPIN1, INPUT_PULLUP);
+  attachPinChangeInterrupt(MYPIN1, quicfunc, FALLING);  // add more attachInterrupt code as required
+  pinMode(MYPIN2, INPUT_PULLUP);
+  attachPinChangeInterrupt(MYPIN2, quicfunc, FALLING);
+  pinMode(MYPIN3, INPUT_PULLUP);
+  attachPinChangeInterrupt(MYPIN3, pin3func, CHANGE);
+  */
+ 
+//  pinMode(ROTTARY_SW_sw, INPUT);     //set the pin to input
+//  digitalWrite(ROTTARY_SW_sw, HIGH); //use the internal pullup resistor
+  

+ 25 - 0
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW.h

@@ -0,0 +1,25 @@
+// rottary switch ports 
+#define ROTTARY_SW_sw A8 // 62 // A8 //A8 //53 // 89 // = A8
+#define ROTTARY_SW_dt A9 // 90 // = A9
+#define ROTTARY_SW_clk A10 // 91 // = A10
+
+ // You can assign any number of functions to different pins. How cool is that?
+void ROTTARY_SW_sw_INT() {
+   Serial.println("ROTTARY_SW_sw_INT TRIG");
+}
+
+void ROTTARY_SW_dt_INT() {
+   Serial.println("ROTTARY_SW_dt_INT TRIG");
+}
+void ROTTARY_SW_clk_INT() {
+   Serial.println("ROTTARY_SW_clk_INT TRIG");
+}
+
+/*
+ LOW to trigger the interrupt whenever the pin is low,
+CHANGE to trigger the interrupt whenever the pin changes value
+RISING to trigger when the pin goes from low to high,
+FALLING for when the pin goes from high to low.
+The Due, Zero and MKR1000 boards allow also:
+HIGH to trigger the interrupt whenever the pin is high.
+ */

+ 8 - 0
SE/stuff/P5_Automation_can-dev-res/_ROTTARY_SW_setup.h

@@ -0,0 +1,8 @@
+
+  attachPinChangeInterrupt(ROTTARY_SW_sw, ROTTARY_SW_sw_INT, FALLING);  // add more attachInterrupt code as required
+  pinMode(ROTTARY_SW_sw, INPUT_PULLUP);
+  attachPinChangeInterrupt(ROTTARY_SW_dt, ROTTARY_SW_dt_INT, FALLING); //FALLING //RISING 
+  pinMode(ROTTARY_SW_dt, INPUT_PULLUP);
+  attachPinChangeInterrupt(ROTTARY_SW_clk, ROTTARY_SW_clk_INT, FALLING); //CHANGE
+  pinMode(ROTTARY_SW_clk, INPUT_PULLUP);
+  

+ 83 - 0
SE/stuff/P5_Automation_can-dev-res/_SlaveID_loop1.h

@@ -0,0 +1,83 @@
+if(!digitalRead(CAN_INTpin))                    // If pin 2 is low, read receive buffer
+          {
+            CAN0.readMsgBuf(&CANrxId, &CANlen, CANrxBuf); // Read data: len = data length, buf = data byte(s)
+            Serial.print("ID: ");
+            Serial.print(CANrxId, HEX);
+            Serial.print(" Data: ");
+             #if defined(HAS_LCD1602)
+              lcd.setCursor(0,0); 
+              lcd.print("ID: ");
+              lcd.print(CANrxId, HEX);
+              lcd.setCursor(0,1); 
+              lcd.print(" Data: ");
+             #endif
+         /*     #if defined(HAS_TFT_ILI9163C)
+             display.setCursor(0,40); 
+              display.print("ID: ");
+              display.print(CANrxId, HEX);
+              display.setCursor(0,50); 
+              display.print(" Data: ");
+             #endif
+             */
+            for(int i = 0; i<CANlen; i++)           // Print each byte of the data
+            {
+              if(CANrxBuf[i] < 0x10)                // If data byte is less than 0x10, add a leading zero
+              {
+                Serial.print("0");
+                 #if defined(HAS_LCD1602)
+                    lcd.print("0");
+                 #endif
+            //     #if defined(HAS_TFT_ILI9163C)
+            //        display.print("0");
+            //     #endif
+              }
+              Serial.print(CANrxBuf[i], HEX);
+              Serial.print(" ");
+               #if defined(HAS_LCD1602)
+                  lcd.print(CANrxBuf[i], HEX);
+                  lcd.print(" ");
+               #endif
+        //       #if defined(HAS_TFT_ILI9163C)
+        //          display.print(CANrxBuf[i], HEX);
+        //          display.print(" ");
+        //       #endif
+
+               if(_Slave_Ports_queue_task_type_LIST[i]) {
+                   Serial.print(" [");  Serial.print(_Slave_Ports_queue_task_type_LIST[i]);   Serial.print("] "); 
+               }
+               
+            }
+            Serial.println();
+
+
+
+         
+
+
+
+
+
+
+            
+          }
+        //EOF CAN
+          #if defined(HAS_LCD1602)
+            delay(LCDtim);  
+            //lcd.setCursor(0,1); 
+            lcd.print(lcdPattern);
+            //lcd.print(lcdPos % 10);
+            if(lcdPos == 16) { 
+              //lcd.print("N");
+              lcd.setCursor(0,1); 
+              lcdPos = 0;
+              if(lcdPattern==".") lcdPattern = "-" ;
+              else lcdPattern = "." ;
+            }
+            lcdPos ++;
+          #endif
+       //   #if defined(HAS_TFT_ILI9163C)
+       //     delay(LCDtim);  
+        //    display.setCursor(0,60); 
+       //     display.print("loop....");
+       //   #endif
+          

+ 17 - 0
SE/stuff/P5_Automation_can-dev-res/_SlaveID_setup.h

@@ -0,0 +1,17 @@
+LCDarray1 = "Slave Module ";
+        LCDarray2 = "enabling filters";
+        //CAN0.init_Mask(0,0,0x010F0000);                // Init first mask...
+        //CAN0.init_Filt(0,0,0x01000000);                // Init first filter...
+        //CAN0.init_Filt(1,0,0x01010000);                // Init second filter...
+        
+        //CAN0.init_Mask(1,0,0x010F0000);                // Init second mask... 
+        //CAN0.init_Filt(2,0,0x01030000);                // Init third filter...
+        //CAN0.init_Filt(3,0,0x01040000);                // Init fouth filter...
+        //CAN0.init_Filt(4,0,0x01060000);                // Init fifth filter...
+        //CAN0.init_Filt(5,0,0x01070000);                // Init sixth filter...
+        
+        //CAN0.init_Mask(0, 0, 0x01FF);                         
+        //CAN0.init_Filt(0, 0, 0x103); 
+  
+        //CAN.init_Mask(1, 0, 0x04FF);   
+        //CAN.init_Filt(1, 0, 0x4C0); 

+ 639 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports.h

@@ -0,0 +1,639 @@
+#include "_Slave_Ports_ttl_decrement.h"
+
+
+
+
+typedef struct  {
+  const char * const _Protocol;
+  int _Slave_ID; //remote id - use FF for broadcast
+  int PortTypes;  //0xFF  =  1111 1111 s
+                                          /*
+                                          {
+                                      bit 1 - PWM port
+                                      bit 2 - on I2C managed port
+                                      bit 3 - expanded port with LocalPort address
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    } 
+                                           */
+ // byte has_Address;
+  int Address ;
+ // byte has_Local_Port;
+  int LocalPort;
+  int Exp_state;                  /*0xFF  =  1111 1111
+                                    0x00  =  0000 0000  = OFF = 0V
+                                    0x01  =  0000 0001  = ON = PWM max
+                                    {
+                                      bit 1 - OFF = 0V
+                                      bit 2 - ON = PWM max
+                                      bit 3 - not allocated
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    }*/
+  int Exp_state_ttl;  // 0x00 = odswiezyc
+  //int Broadcast_state; //0x00 - not broadcast; 0x01
+} _Slave_Port;
+
+
+
+/*
+ * 
+_Slave_Port _Slave_Ports[] = {
+  {"CAN", 0x102, 0x01, 0x00, 0x00, 0x00, 0x00 }
+  //,
+  //{"CAN", 0x102, 0x01, 0x00, 0x01, 0xFF, 0x6d } //testowy ttl
+};
+*/
+#include "_Slave_Ports_LOCAL.h"
+#include "_Slave_Ports_queue_task_type_LIST.h"
+
+
+ struct _Slave_Ports_queue_tasksS {
+  int queueID;
+  int _Slave_Ports_queue_task_type ; /*
+              { 0x01 _Slave_Ports_ttl_decrement, 
+                 0x02  request_confirm_Exp_state ,
+                 0x03  request_set_new_Exp_state,
+                 0x04 
+                  }
+  */
+  int _Slave_Port_link; //todo link
+ long time_seq_id;
+ long time_min_run;
+} ;
+
+typedef struct _Slave_Ports_queue_tasksS _Slave_Ports_queue_tasksT;
+
+_Slave_Ports_queue_tasksT _Slave_Ports_queue_tasks_LIST[11];
+
+
+
+  
+
+
+void _Slave_Ports_queue__INIT( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST) {
+  Serial.println("_Slave_Ports_queue__INIT");
+   int i;
+  for(i=0;i<10;i++) {
+   _Slave_Ports_queue_tasks_LIST[i].queueID = 0;
+     _Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type = 0x00;
+      _Slave_Ports_queue_tasks_LIST[i]._Slave_Port_link = 0x00;
+       _Slave_Ports_queue_tasks_LIST[i].time_seq_id = 0;
+        _Slave_Ports_queue_tasks_LIST[i].time_min_run = 0;
+        
+      //  _Slave_Ports_queue_tasks_LIST[i]=_Slave_Ports_queue_tasks_LIST[i];
+   }
+   
+}
+
+
+String _Slave_Ports_queue_task_type_DESC( int _Slave_Ports_queue_task_type ) {//, int* res
+ /* if(_Slave_Ports_queue_task_type == 0x01) res=0x99; //res="_Slave_Ports_ttl_decrement";
+  else if(_Slave_Ports_queue_task_type == 0x02) res=0x99; //res="request_confirm_Exp_state";
+  else if(_Slave_Ports_queue_task_type == 0x03) res=0x99; //res="request_set_new_Exp_state";
+  else {
+    res=0x99; // res="_UNKNOIWN";
+    Serial.print("#82 Get [");  Serial.print(_Slave_Ports_queue_task_type); Serial.println("] #82 [U] ");
+  }
+  *//*
+ // char return_i;
+  Serial.print("=["); Serial.print(_Slave_Ports_queue_task_type); Serial.print("] ");
+ if(_Slave_Ports_queue_task_type == 0x01)   Serial.print("_Slave_Ports_ttl_decrement"); // return "_Slave_Ports_ttl_decrement";
+  else if(_Slave_Ports_queue_task_type == 0x02)  Serial.print("request_confirm_Exp_state"); //return "request_confirm_Exp_state";
+  else if(_Slave_Ports_queue_task_type == 0x03)   Serial.print("request_set_new_Exp_state"); //return "request_set__new_Exp_state";
+  else //return_i = "_UNKNOIWN"; //return "_UNKNOIWN";
+   Serial.print("_UNKNOIWN");
+// Serial.print((String)return_i);
+//  return return_i ;
+*/
+ //Serial.print(_Slave_Ports_queue_task_type[_Slave_Ports_queue_task_type]); 
+  return _Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_task_type]; 
+ //  String ret = "aaaaxxx";
+   //return ret;
+}
+
+
+//Queue<_Slave_Ports_queueT> _Slave_Ports_queue = Queue<_Slave_Ports_queueT>(5);
+void _Slave_Ports_queue__list( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST) {
+  int i;
+    Serial.println("#100 _Slave_Ports_queue_tasks_LIST): ");
+    //Serial.println(sizeof(_Slave_Ports_queue_tasks_LIST));
+        for(i=0;i<=10;i++) { //sizeof(_LCD_print_buffors)
+
+          if(_Slave_Ports_queue_tasks_LIST[i].queueID == 0 and _Slave_Ports_queue_tasks_LIST[i].queueID == 0 and _Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type == 0 and _Slave_Ports_queue_tasks_LIST[i]._Slave_Port_link == 0 and _Slave_Ports_queue_tasks_LIST[i].time_seq_id == 0 and _Slave_Ports_queue_tasks_LIST[i].time_min_run == 0 ) {
+            
+          } else {
+                Serial.print(" $i[");
+                Serial.print(i);
+
+                 Serial.print("] queueID: ");
+                Serial.print(_Slave_Ports_queue_tasks_LIST[i].queueID);
+
+                   
+
+                 Serial.print("] _Slave_Ports_queue_task_type: ");
+                                 Serial.print(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type);
+                  Serial.print("] desc: ");
+                 //Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type);
+                 //char res;
+                 // res = _Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type);  Serial.print(res);
+                  Serial.print(_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type));
+                  Serial.print(" - map[");  Serial.print(_Slave_Ports_queue_task_type_LIST[_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type]);  Serial.print("]"); 
+               // Serial.print(_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type)) ; //(res); //_Slave_Ports_queue_task_type_DESC(_Slave_Ports_queue_tasks_LIST[i]._Slave_Ports_queue_task_type
+
+  
+                 Serial.print("] _Slave_Port_link: ");
+                Serial.print(_Slave_Ports_queue_tasks_LIST[i]._Slave_Port_link);
+                     
+                     
+                    Serial.print("] time_seq_id: ");
+                Serial.print(_Slave_Ports_queue_tasks_LIST[i].time_seq_id);
+
+                     Serial.print("] time_min_run: ");
+                Serial.println(_Slave_Ports_queue_tasks_LIST[i].time_min_run);
+                }
+  
+        }
+}
+
+/*
+ struct _Slave_Ports_queue_tasksS {
+  int queueID;
+  int _Slave_Ports_queue_task_type ; /*
+              { 0x01 _Slave_Ports_ttl_decrement, 
+                 0x02  request_confirm_Exp_state ,
+                 0x03  request_set_new_Exp_state,
+                 0x04   _Slave_Ports_ttl_decrement }
+ 
+  int _Slave_Port_link; //todo link
+ long time_seq_id;
+ long time_min_run;
+} ;
+
+ */
+void _Slave_Ports_queue__add( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST,int _Slave_Ports_queue_task_type,int _Slave_Port_link,long time_seq_id, long time_min_run //, 
+//int _Slave_Ports_queue_peek , int _Slave_Ports_queue_push , int _Slave_Ports_queue_peek_new
+) {
+  Serial.println(".");
+      Serial.print("#152 _Slave_Ports_queue__add  peek: ["); 
+       int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek() ;
+       int _Slave_Ports_queue_back = _Slave_Ports_queue.back() ;
+     //  int _Slave_Ports_queue_push_new_ref;
+      // if(_Slave_Ports_queue_back > _Slave_Ports_queue_peek)
+      Serial.print(_Slave_Ports_queue_peek);  Serial.print("] cur back[");  Serial.print(_Slave_Ports_queue_back); Serial.print("] ");
+      
+     
+     _Slave_Ports_queue.push(_Slave_Ports_queue_back + 1);
+      int _Slave_Ports_queue_peek_new = _Slave_Ports_queue.peek() ;
+     // int _Slave_Ports_queue__push = _Slave_Ports_queue__peek + 1 ;
+             Serial.print("] new peek[");
+             Serial.print(_Slave_Ports_queue_peek_new );    Serial.print("]  planned["); Serial.print(_Slave_Ports_queue_back + 1 );  
+             Serial.print("] front[");   Serial.print(_Slave_Ports_queue.front());   Serial.print("] back[");   Serial.print(_Slave_Ports_queue.back());  Serial.println("] ");
+
+ 
+             
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_back + 1 ].queueID=_Slave_Ports_queue_back + 1 ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_back + 1 ]._Slave_Ports_queue_task_type=_Slave_Ports_queue_task_type ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_back + 1 ]._Slave_Port_link=_Slave_Port_link ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_back + 1 ].time_seq_id=time_seq_id ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_back + 1 ].time_min_run=time_min_run ;
+    
+}
+
+/*
+ void _Slave_Ports_queue__add(const _Slave_Ports_queue_tasksT*  &_Slave_Ports_queue_tasks_LIST  ,
+int _Slave_Ports_queue_task_type, int _Slave_Port_link, long time_seq_id, long time_min_run //, 
+//int _Slave_Ports_queue_peek , int _Slave_Ports_queue_push , int _Slave_Ports_queue_peek_new
+) {
+      Serial.print("#152 _Slave_Ports_queue__add  peek: ["); 
+       int _Slave_Ports_queue_peek = _Slave_Ports_queue.peek() ;
+      Serial.print(_Slave_Ports_queue_peek);
+      
+     
+      int _Slave_Ports_queue_push = _Slave_Ports_queue_peek + 1;
+      int _Slave_Ports_queue_peek_new = _Slave_Ports_queue_push ; //_Slave_Ports_queue.peek() ;
+     // int _Slave_Ports_queue__push = _Slave_Ports_queue__peek + 1 ;
+             Serial.print("] new peek[");
+             Serial.print(_Slave_Ports_queue_peek_new );    Serial.print("]  planned["); Serial.print(_Slave_Ports_queue_peek + 1 );   Serial.println("]");
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_peek_new].queueID=_Slave_Ports_queue_peek_new;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_peek_new]._Slave_Ports_queue_task_type=_Slave_Ports_queue_task_type ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_peek_new]._Slave_Port_link=_Slave_Port_link ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_peek_new].time_seq_id=time_seq_id ;
+     _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_peek_new].time_min_run=time_min_run ;
+
+    //return _Slave_Ports_queue_tasks_LIST;
+}
+
+
+*/
+
+
+
+
+
+ void _Slave_Ports_ttl_decrement_POP(_Slave_Ports_queue_tasksT*  _Slave_Ports_queue_tasks_LIST,int _Slave_Ports_queue_pop ,  _Slave_Port* _Slave_Ports) {
+     Serial.print("#213 _Slave_Ports_ttl_decrement_POP.   sizeof _Slave_Ports[");     Serial.print(sizeof(_Slave_Ports));
+    int i;
+    for(i=0;i<=100;i++) {
+      if(_Slave_Ports[i]._Protocol == "CAN") {
+            if(_Slave_Ports[i].Exp_state_ttl > 0x00 ) {
+               Serial.print("#217 ttl min for: Prot[");  Serial.print(_Slave_Ports[i]._Protocol);   Serial.print("] ttl[");  Serial.print(_Slave_Ports[i].Exp_state_ttl);  Serial.print(" id[");  Serial.print(i);   Serial.println("]  "); 
+            }
+
+      }
+    }
+
+
+ /*
+   const char * const _Protocol;
+  int _Slave_ID;
+  int PortTypes;  //0xFF  =  1111 1111 {  PWM,  .....} = 0x80
+ // byte has_Address;
+  int Address ;
+ // byte has_Local_Port;
+  int LocalPort;
+  int Exp_state;                  /*0xFF  =  1111 1111
+                                    0x00  =  0000 0000  = OFF = 0V
+                                    0x01  =  0000 0001  = ON = PWM max
+                                    {
+                                      bit 1 - OFF = 0V
+                                      bit 2 - ON = PWM max
+                                      bit 3 - not allocated
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                   
+  int Exp_state_ttl;  // 0x00 = odswiezyc
+
+  */
+ 
+ } 
+
+
+
+ void _Slave_Ports_broadcast_POP(_Slave_Ports_queue_tasksT*  _Slave_Ports_queue_tasks_LIST, int _Slave_Ports_queue_pop ,  _Slave_Port*  _Slave_Ports, int LCDtim ) {
+        Serial.println("#251 _Slave_Ports_broadcast_POP");
+          int i;
+          for(i=0;i<=100;i++) {
+            if(_Slave_Ports[i]._Protocol == "CAN") {
+              Serial.print(" ind:"); Serial.print(i);  Serial.print("] Prot:");
+              Serial.print(_Slave_Ports[i]._Protocol);
+              Serial.print(" , ID:"); 
+              Serial.print(_Slave_Ports[i]._Slave_ID, HEX); Serial.print(" , PortTypes:");
+             Serial.print(_Slave_Ports[i].PortTypes, HEX); Serial.print(" , Addr:"); Serial.print(_Slave_Ports[i].Address, HEX);
+              Serial.print(" , Local:"); Serial.print(_Slave_Ports[i].LocalPort);
+              Serial.print(" , Exp state:"); Serial.print(_Slave_Ports[i].Exp_state);
+                Serial.print(" , Exp_state_ttl"); Serial.println(_Slave_Ports[i].Exp_state_ttl);  
+
+
+                        Serial.println(" Prepared data");
+                        #if defined(HAS_LCD1602)                              
+                             String LCDarray1 = "P[";
+                             LCDarray1.concat(_Slave_Ports[i]._Protocol); LCDarray1.concat("] ID["); LCDarray1.concat(String(_Slave_Ports[i]._Slave_ID, HEX)); LCDarray1.concat("] T["); LCDarray1.concat(String(_Slave_Ports[i].PortTypes, HEX));
+                            // lcd.print(LCDarray1);
+                            String LCDarray2 = " >"; LCDarray2.concat(String(_Slave_Ports[i].Address, HEX)); LCDarray2.concat( "< {"); LCDarray2.concat( String(_Slave_Ports[i].LocalPort, HEX)); LCDarray2.concat( "} =[" ); LCDarray2.concat(String(_Slave_Ports[i].Exp_state, HEX) ); LCDarray2.concat("] ?[" ) ;
+                                 LCDarray2.concat(String(_Slave_Ports[i].Exp_state_ttl, HEX)) ; LCDarray2.concat("]") ;
+                                 LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
+                        #endif
+                        //                        (0)           (1)           (2)                       (3)                         (4)                         (5)                     (6)                   
+                      byte data[8] = {_Slave_Ports[i].Address,  0x04, _Slave_Ports[i].LocalPort, _Slave_Ports[i].PortTypes, _Slave_Ports[i].LocalPort, _Slave_Ports[i].Exp_state, _Slave_Ports[i].Exp_state_ttl, 0x07};
+                     // byte data[8] = {element.Address,          0x04, element.LocalPort,          element.PortTypes,                element.LocalPort,         element.Exp_state,         element.Exp_state_ttl, 0x07};
+                  Serial.print("#303 byte data[8] 1[");   Serial.print(_Slave_Ports[i].Address);   Serial.print("] 2[");  Serial.print(0x04);   Serial.print("] 3["); 
+                       Serial.print(_Slave_Ports[i].LocalPort);   Serial.print("] 4[");    Serial.print(_Slave_Ports[i].PortTypes);   Serial.print("] 5[");  Serial.print(_Slave_Ports[i].Exp_state);   Serial.print("] 6[");
+                        Serial.print( _Slave_Ports[i].Exp_state_ttl);   Serial.print("] 7[");  Serial.print(0x07);   Serial.println("] ");
+                 byte sndStat = CAN0.sendMsgBuf(_Slave_Ports[i]._Slave_ID, 0, 8, data);
+              //    byte sndStat ;
+                          if(sndStat == CAN_OK){
+                            Serial.println("Message Sent Successfully!");
+                             String LCDarray1 = "Message Sent";
+                             String LCDarray2 = "Successfully";
+                          } else {
+                            Serial.println("Error Sending Message...");
+                            String LCDarray1 = "Error Sending";
+                            String LCDarray2 = "Message...";
+                          }
+
+                            #if defined(HAS_LCD1602)
+                                    LCD_print(LCDarray1,LCDarray2,LCDtim);
+                                  /*
+                                   delay(LCDtim * 5);  
+                                    //lcd.setCursor(0,1); 
+                                    lcd.print(lcdPattern);
+                                    //lcd.print(lcdPos % 10);
+                                  if(lcdPos >= 16) { 
+                                    //lcd.print("N");
+                                    lcd.setCursor(0,1); 
+                                    lcdPos = 0;
+                                    if(lcdPattern=="s") lcdPattern = "S" ;
+                                    else lcdPattern = "s" ;
+                                  }
+                                    lcdPos ++;
+                                    |*/
+                                 #endif
+                                //  #if defined(HAS_TFT_ILI9163C)
+                                //    delay(LCDtim);  
+                                //    display.setCursor(0,60); 
+                               //     display.print(LCDarray1); display.print(" "); display.print(LCDarray2);
+                               //   #endif
+
+                                      delay(5000);   // send data per 100ms
+                }
+
+
+                          
+                                
+                     
+
+             
+
+
+                
+            }
+          
+
+          /*
+           for (auto element: _Slave_Ports) {
+            ind++;
+              Serial.print(" ind:"); Serial.print(ind);  Serial.print("] Prot:"); Serial.print(element._Protocol); Serial.print(" , ID:"); Serial.print(element._Slave_ID); Serial.print(" , PortTypes:");
+             Serial.print(element.PortTypes); Serial.print(" , Addr:"); Serial.print(element.Address);
+              Serial.print(" , Local:"); Serial.print(element.LocalPort);
+              Serial.print(" , Exp state:"); Serial.print(element.Exp_state);
+                Serial.print(" , Exp_state_ttl"); Serial.println(element.Exp_state_ttl);  
+                if(element._Protocol == "CAN") { 
+                       Serial.println(" Prepared data");
+                        #if defined(HAS_LCD1602)                              
+                               
+                             String LCDarray1 = "P[";
+                             LCDarray1.concat(element._Protocol); LCDarray1.concat("] ID["); LCDarray1.concat(String(element._Slave_ID, HEX)); LCDarray1.concat("] T["); LCDarray1.concat(String(element.PortTypes, HEX));
+                            // lcd.print(LCDarray1);
+                            String LCDarray2 = " >"; LCDarray2.concat(String(element.Address, HEX)); LCDarray2.concat( "< {"); LCDarray2.concat( String(element.LocalPort, HEX)); LCDarray2.concat( "} =[" ); LCDarray2.concat(String(element.Exp_state, HEX) ); LCDarray2.concat("] ?[" ) ;
+                                 LCDarray2.concat(String(element.Exp_state_ttl, HEX)) ; LCDarray2.concat("]") ;
+                                 LCD_print(LCDarray1, LCDarray2, LCDtim / 2 ) ;
+                        #endif
+                      byte data[8] = {element.Address, 0x04, element.LocalPort, element.PortTypes, element.LocalPort, element.Exp_state, element.Exp_state_ttl, 0x07};
+                  // }
+                 byte sndStat = CAN0.sendMsgBuf(element._Slave_ID, 0, 8, data);
+                 
+                          if(sndStat == CAN_OK){
+                            Serial.println("Message Sent Successfully!");
+                             String LCDarray1 = "Message Sent";
+                             String LCDarray2 = "Successfully";
+                          } else {
+                            Serial.println("Error Sending Message...");
+                            String LCDarray1 = "Error Sending";
+                            String LCDarray2 = "Message...";
+                          }
+                }
+
+
+                          
+                                  #if defined(HAS_LCD1602)
+
+                                  
+                                   delay(LCDtim * 5);  
+                                    //lcd.setCursor(0,1); 
+                                    lcd.print(lcdPattern);
+                                    //lcd.print(lcdPos % 10);
+                                  if(lcdPos >= 16) { 
+                                    //lcd.print("N");
+                                    lcd.setCursor(0,1); 
+                                    lcdPos = 0;
+                                    if(lcdPattern=="s") lcdPattern = "S" ;
+                                    else lcdPattern = "s" ;
+                                  }
+                                    lcdPos ++;
+                          #endif
+                                  #if defined(HAS_TFT_ILI9163C)
+                                    delay(LCDtim);  
+                                    display.setCursor(0,60); 
+                                    display.print(LCDarray1); display.print(" "); display.print(LCDarray2);
+                                  #endif
+                          delay(5000);   // send data per 100ms
+
+             
+            }*/
+          
+          
+           
+          
+         // byte sndStat = CAN0.sendMsgBuf(_Slave1_ID, 0, 8, data);
+
+
+ } //EOF _Slave_Ports_broadcast_POP
+ 
+
+ void _Slave_Ports_queue__POP( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST, 
+ int _Slave_Ports_queue_count, 
+ int _Slave_Ports_queue_pop, 
+ int _Slave_Ports_queue_front, 
+ int _Slave_Ports_queue_back,
+ int _Slave_Ports_queue_peek,
+ int LCDtim,  _Slave_Port* _Slave_Ports) {
+   //int count = _Slave_Ports_queuev.count();
+   //int _Slave_Ports_queue_pop _Slave_Ports_queuev.pop();
+  Serial.print("#180 run _Slave_Ports_queue__POP cnt "); Serial.print(_Slave_Ports_queue_count); Serial.print(" , pop: "); Serial.println(_Slave_Ports_queue_pop);
+
+   
+    if (_Slave_Ports_queue_count > 0) {
+
+                             String LCDarray1 = "`Slave_Ports_queue size [";
+                             LCDarray1.concat(_Slave_Ports_queue_count);
+                             LCDarray1.concat("] Oldest["); 
+                             LCDarray1.concat(_Slave_Ports_queue_pop);
+                             
+                             LCDarray1.concat("] Curr[");
+                             LCDarray1.concat(_Slave_Ports_queue_front);
+
+                             String LCDarray2 = "]  last[";
+                             LCDarray2.concat(_Slave_Ports_queue_back);
+                             LCDarray2.concat("] Next[");
+                             LCDarray2.concat(_Slave_Ports_queue_peek);
+                             
+  
+    Serial.print(LCDarray1);
+    Serial.println(LCDarray2);
+//    LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
+
+              if(_Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].queueID == 0 and 
+                _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].queueID == 0 and 
+                  _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0 and 
+                    _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Port_link == 0 and 
+                      _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].time_seq_id == 0 and 
+                        _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop].time_min_run == 0 ) {
+                   String LCDarray1 = "#206 Error with queue";
+                   String LCDarray2 = "ID: ";
+                    LCDarray2.concat( _Slave_Ports_queue_pop);  LCDarray2.concat("] ");
+                   Serial.print(LCDarray1);
+                   Serial.println(LCDarray2);
+          //          LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
+              } else {
+                   String LCDarray1 = "#407 Running task";
+                   String LCDarray2 = "ID: ";
+                    LCDarray2.concat( _Slave_Ports_queue_pop);  LCDarray2.concat("] task_type[");
+                      
+                        LCDarray2.concat( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type);  LCDarray2.concat("] ");
+                   
+                   Serial.print(LCDarray1);
+                   Serial.println(LCDarray2);
+            //        LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
+
+                        if( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0x01 ) {
+                           Serial.print("#224 running _Slave_Ports_ttl_decrement = ");     Serial.println( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type);
+                            #include "_Slave_Ports_ttl_decrement.h"
+                           _Slave_Ports_ttl_decrement_POP(_Slave_Ports_queue_tasks_LIST, _Slave_Ports_queue_pop ,  _Slave_Ports ) ; 
+                           
+                        } else if( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type == 0x04 ) {
+                           Serial.print("#337 running _Slave_Ports_broadcast = ");     Serial.println( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type);
+                            #include "_Slave_Ports_ttl_decrement.h"
+                           _Slave_Ports_broadcast_POP(_Slave_Ports_queue_tasks_LIST, _Slave_Ports_queue_pop ,  _Slave_Ports, LCDtim ) ; 
+                           
+                        }  else {
+                            Serial.print("Error unsupported type ");     Serial.println( _Slave_Ports_queue_tasks_LIST[_Slave_Ports_queue_pop]._Slave_Ports_queue_task_type);
+                        }
+
+                    
+              }
+
+
+   
+  } else {
+    String LCDarray1 = "Nothing to";
+    String LCDarray2 = "process...";
+    //LCDarray2.reserve(16);
+    Serial.print(LCDarray1); 
+    Serial.println(LCDarray2); 
+
+   //  Serial.print("#32 String LCDarray2 len"); 
+    // int LCDarray2_length = LCDarray2.length;
+   /*  Serial.print(LCDarray2.length()); 
+     Serial.println("] now "); 
+     LCDarray2 = make_str16(LCDarray2);
+    Serial.print(LCDarray2.length()); 
+     Serial.println("]  next #338"); 
+
+      for(int i = 0; i < (17 - LCDarray2.length()); i++)
+        LCDarray2 += 'x';  
+       
+      Serial.print(LCDarray2.length()); 
+     Serial.println("]  "); 
+ */
+    
+    Serial.print(" #364 scount "); 
+     Serial.print(_Slave_Ports_queue_count); 
+     Serial.print(" _Slave_Ports_queue.front(): "); 
+     Serial.print(_Slave_Ports_queue_front); 
+     Serial.print(" _Slave_Ports_queue.back(): "); 
+     Serial.print(_Slave_Ports_queue_back); 
+     Serial.print(" _Slave_Ports_queue.peek(): "); 
+     Serial.println(_Slave_Ports_queue_peek); 
+//     LCD_print(LCDarray1, LCDarray2, LCDtim / 3 ) ;
+  }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+struct _Slave_Port
+{ 
+  char _Protocol ;
+  int _Slave_ID;
+  char Port_Type;
+  int Address;
+  int LocalPort ;
+  void (*fn)();
+};
+
+
+struct _Slave_Port {
+   
+}
+
+#define _Slave_Port =   { "CAN" , 0x102 , "PWM", 0x00, 0  } 
+
+*/
+
+  /* #define __CAN_Ports { _Slave1_ID } ;
+
+
+   #define __CAN_Ports_PWM { _Slave1_ID 
+    {0x00 , 0 } ,
+    {0x00 , 1 }
+   } ;
+
+   */
+/*
+   typedef struct
+ {
+     int Slave1_ID;
+     String PortType;
+     int Address;
+     int LocalPort ;
+ } 
+
+*/
+/*
+
+struct buttons
+{ 
+  int color[3];
+  int positions[4];
+  char init[20];
+  void (*fn)();
+};
+
+//void func1();
+//void func2();
+
+  
+buttons test[] = 
+{
+  { {0,0,0},    {0,0,100,100}, "getSomething",  func1 },
+  { {40,40,40}, {50,50,10,10}, "somethingElse", func2 },
+};
+*/
+
+/*
+typedef struct  {
+  const char * const l_name;
+  byte x_m;
+  byte y_m;
+  boolean period[4];
+} myStruct;
+
+myStruct structs[] = {
+  {"My Name", 0, 0, {true, true, false, false}},
+  {"My Second Name", 0, 0, {true, false, true, false}}
+};
+*/
+
+
+
+ //#define _CAN_P_0x102_PWM0x00_0 { _Slave1_ID , "PWM", 0x00, 0 } 
+ //#define _CAN_P_0x102_PWM0x00_1 { _Slave1_ID , "PWM", 0x00, 1 } 
+ // char _Slave_Ports ;
+ // _Slave_Ports[0] = "_CAN_P_0x102_PWM0x00_0"  ;
+ // _Slave_Ports[1] = "_CAN_P_0x102_PWM0x00_1"  ;
+
+ // char *_Slave_Ports[] = { "_CAN_P_0x102_PWM0x00_0", "_CAN_P_0x102_PWM0x00_1" } ;

+ 46 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_LOCAL.h

@@ -0,0 +1,46 @@
+
+_Slave_Port _Slave_Ports[] = {
+  {"CAN", 0x102, 0x07, 0x00, 0x00, 0x00, 0x00 }
+  //,
+  //{"CAN", 0x102, 0x01, 0x00, 0x01, 0xFF, 0x6d } //testowy ttl
+};
+
+/*
+typedef struct  {
+  const char * const _Protocol;
+  int _Slave_ID;
+  int PortTypes;  //0xFF  =  1111 1111 
+                                          {
+                                      bit 1 - PWM port
+                                      bit 2 - on I2C managed port
+                                      bit 3 - expanded port with LocalPort address
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    } 
+                                        
+ // byte has_Address;
+  int Address ;
+ // byte has_Local_Port;
+  int LocalPort;
+  int Exp_state;                  0xFF  =  1111 1111
+                                    0x00  =  0000 0000  = OFF = 0V
+                                    0x01  =  0000 0001  = ON = PWM max
+                                    {
+                                      bit 1 - OFF = 0V
+                                      bit 2 - ON = PWM max
+                                      bit 3 - not allocated
+                                      bit 4 - not allocated
+                                      bit 2 - not allocated
+                                      bit 5 - not allocated
+                                      bit 6 - not allocated
+                                      bit 7 - not allocated
+                                      bit 8 - not allocated
+                                    }
+  int Exp_state_ttl;  // 0x00 = odswiezyc
+} _Slave_Port;
+
+*/

+ 32 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_Protocol_CAN.h

@@ -0,0 +1,32 @@
+
+
+
+/*
+byte data[8] = {element.Address, -1 
+                 _Slave_Ports_queue_task_type_LIST, -2  type of protocol task
+                 element.LocalPort, -3
+                 element.PortTypes, -4
+                 element.LocalPort, -5
+                 element.Exp_state, -6
+                  element.Exp_state_ttl, -7
+                  packet_ttl }; 
+*/
+
+const byte _Slave_Ports_Protocol_CAN_COUNT = 32;
+
+//byte sndStat = CAN0.sendMsgBuf(_Slave_Ports[i]._Slave_ID, 0, 8, data);
+
+
+const char _Slave_Ports_Protocol_CAN_LIST[][_Slave_Ports_Protocol_CAN_COUNT] = {
+        "REMOTE_ID", //0 - use 0xFF fof broadcast
+        "NOT_USED_ZERO", //1
+        "_Slave_Ports_queue_task_type",  //2
+        "LocalPort",  //3
+        "PortTypes", //4
+         "LocalPort", //5  - to set ports associated on PW
+          "Exp_state", //6
+           "Exp_state_ttl", //7
+          "_MSG_TTL" //8 like in tcp/ip
+        }; 
+        
+        

+ 41 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_func.h

@@ -0,0 +1,41 @@
+
+void _Slave_Ports_ttl_decrement ();
+
+void _Slave_Ports_action_queue ();  //request_confirm_Exp_state  //request_set__new_Exp_state
+
+//void LCD_print_background_screen_add(_LCD_print_screensT* _LCD_print_screens, int screenID,long time_seq_id, long time_min_run, String LCDarray1, String LCDarray2 ) {
+  //time_seq_id - used to maintain single display context
+  //time_max - used to how much time to keep in displayed text
+  
+    
+void _Slave_Ports_message_CAN_to_queue(); //
+void  _Slave_Ports_message_queue_to_CAN() ;//
+void  _Slave_Ports_message_queue_to_PWM() ;//
+
+/*
+  int queueID;
+  int _Slave_Ports_queue_task ; /*
+              { 0x01 _Slave_Ports_ttl_decrement, 
+                 0x02  request_confirm_Exp_state ,
+                 0x03  request_set__new_Exp_state }
+
+ */
+
+
+
+/*
+ 
+void _LCD_print_screens_list(_LCD_print_screensT* _LCD_print_screens ) {
+ int i;
+
+
+   Serial.print("sizeof(_LCD_print_screens): ");
+    Serial.println(sizeof(_LCD_print_screens));
+ for(i=0;i<=10;i++) { //sizeof(_LCD_print_buffors)
+          Serial.print(" $i[");
+          Serial.print(i);
+
+          Serial.print("] screenID: ");
+          Serial.print(_LCD_print_screens[i].screenID);
+
+ */

+ 19 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_queue_task_type_LIST.h

@@ -0,0 +1,19 @@
+
+const byte _Slave_Ports_queue_task_type_COUNT = 32;
+const char _Slave_Ports_queue_task_type_LIST[][_Slave_Ports_queue_task_type_COUNT] = {
+        "_NOT_USED", //0
+        "_Slave_Ports_ttl_decrement", //1
+        "request_confirm_Exp_state",  //2
+        "request_set_new_Exp_state",  //3
+        "_Slave_Ports_broadcast", //4
+         "_Slave_Ports_set_I2C" //5  - to set ports associated on PW
+        }; 
+        
+//void  _Slave_Ports_message_queue_to_CAN() ;//
+//void  _Slave_Ports_message_queue_to_PWM() ;//
+
+//char _Slave_Ports_queue_task_type[10] = {};
+// _Slave_Ports_queue_task_type = { "_Slave_Ports_ttl_decrement" , "request_confirm_Exp_state" , "request_set_new_Exp_state"} ;
+// { HEX  0x02, "request_confirm_Exp_state" }, 
+// { HEX  0x03, "request_set_new_Exp_state" }
+//};

+ 3 - 0
SE/stuff/P5_Automation_can-dev-res/_Slave_Ports_ttl_decrement.h

@@ -0,0 +1,3 @@
+ 
+ 
+ //void _Slave_Ports_queue__add( _Slave_Ports_queue_tasksT* _Slave_Ports_queue_tasks_LIST,int _Slave_Ports_queue_task_type,int _Slave_Port_link,long time_seq_id, long time_min_run //, 

+ 2 - 1
SE/stuff/P5_Automation_can-dev/_SlaveID_loop1.h

@@ -74,9 +74,10 @@ if(!digitalRead(CAN_INTpin))                    // If pin 2 is low, read receive
             }
             }
             lcdPos ++;
             lcdPos ++;
           #endif
           #endif
+          /*
           #if defined(HAS_TFT_ILI9163C)
           #if defined(HAS_TFT_ILI9163C)
             delay(LCDtim);  
             delay(LCDtim);  
             display.setCursor(0,60); 
             display.setCursor(0,60); 
             display.print("#80 loop....");
             display.print("#80 loop....");
           #endif
           #endif
-          
+          */