// including Boards.h library
  #include <Boards.h>
  
//defining connection (ITV and Pressure sensor pins)  
  ////////////////////////////////////////////////////////////////////////
  #define ITV1 11              //ITV1 connected to analog pin 11
  #define ITV2 10            // ITV2 connected to analog pin 10
  #define PRESSURE1 0          // presssure sensore connected to analog pin 0
  #define PRESSURE2 1          // presssure sensore connected to analog pin 1
  ////////////////////////////////////////////////////////////////////////
  
  // defining variables
  float Pressure1          = 0;
  float Pressure2          = 0;
  float readPressure1      = 0;
  float readPressure2      = 0;
  byte mes_in;
  byte mes_out;
  static byte _array_in[2]; 
  static byte _array_in2[2];
  static byte index;
  static byte index2;
  static byte _array_out[2];
  static byte _array_out2[2];
  
  //int invio;
  byte _invio;
  
  
  int Pressure_temp1;
  int Pressure_temp2;
  int P1;
  int P2;
  int k;
  ////////////////////////////////////////////////////////////////////////
  
  
  // Definition  of Constants
  unsigned long time;            // time for data sampling
  unsigned long time_pressure;
  unsigned long printData;       // time for data sending
  unsigned long readData;        // time for data reading
  
  ////////////////////////////////////////////////////////////////////////
  void setup() {
    
  pinMode (ITV1, OUTPUT);
  //pinMode (ITV2, OUTPUT);
  pinMode (PRESSURE1, INPUT);
  pinMode (PRESSURE2, INPUT);
  
//defining global variable    
  time                      = millis();
  time_pressure             = millis();
  printData                 = millis();
  readData                  = millis();
  
  k                         = 0;
  P1                        = 0;
  P2                        = 0;
  Pressure_temp1            = 0;
  Pressure_temp2            = 0;
  
  Serial.begin(9600);  
    
  }
  
  ////////////////////////////////////////////////////////////////////////

//main loop, function call
  void loop() {
   time                     = millis(); 
   sensor_pressure();
   invio();
   Communication();
   ITV_Control();
}  
