MUX SHIELD 2 - how define (appoint) constants ?

Hello

I am beginner.

I have Mux2 and I need define inputs and outputs.

But there are differents commands, like muxShield.digitalReadMS instead digitalRead etc.

Here orig. code

/*This example shows how to use the Mux Shield for a combination of 
analog inputs, digital inputs, and digital outputs.
*/
#include <MuxShield.h>

//Initialize the Mux Shield
MuxShield muxShield;

void setup()
{
  muxShield.setMode(1,DIGITAL_IN_PULLUP);  //set I/O 1 as digital in with pullup
  muxShield.setMode(2,DIGITAL_OUT);        //set I/O 2 as digital output

  Serial.begin(28800);
}
//Arrays to store input values
int digital1, digital2;

void loop()
{
  //Sample a few inputs from IO1
  digital1 = muxShield.digitalReadMS(1,0);  //IO1, pin 0
  digital2 = muxShield.digitalReadMS(1,1);  //IO1, pin 1
  
  //Set a few outputs on IO2
  muxShield.digitalWriteMS(2,2,HIGH);  //IO2, pin 2
  muxShield.digitalWriteMS(2,3,HIGH);  //IO2, pin 3
  
 
}

I need define in this example

#define LED       2
#define TIME      500
#define BUTTON 5

unsigned long Time;       

void setup() 
{
  pinMode(LED, OUTPUT);             
  pinMode(BUTTON, INPUT_PULLUP);  
  Time = millis();                  
}

void loop() 
{ 
  if(digitalRead(BUTTON) == 0)   
  {
    if(millis() >= Time)                
    { 
      digitalWrite(LED, !digitalRead(LED)); 
      Time = Time + TIME;                   
    }
  }
  else                              
  { 
    digitalWrite(LED, LOW);        
  }
}

an someone help me.

Thank you.
Mirek

Nobody?!

Your question isn't very clear. I'm not sure exactly what you want to know.

Ok
With this code.

Led on 13 ,after to push button blink or is off.
But on mux shiled output (2,15), is still On.

I know ,muxShield.digitalWriteMS(2,15,HIGH); , but how I write it differently ?

How can I write “constant int” for for example led on outputs (2,15)?

I know “muxShield.digitalWriteMS(2,15,HIGH)”, but this activate only output .

But I need define const int" like this.

const int led1 = 2;// leonardo output 2

#include <MuxShield.h>


#define LED       13
#define TIME      500

MuxShield muxShield;

unsigned long Time;       

void setup() 
{
   muxShield.setMode(1,DIGITAL_IN_PULLUP);  //set I/O 1 as digital in with pullup
  muxShield.setMode(2,DIGITAL_OUT);    
  
  pinMode(LED, OUTPUT);             
  
  Time = millis();                  
}
 int digital1 ;
void loop() 
{ 
   digital1 = muxShield.digitalReadMS(1,0);  //IO1, pin 0
   
  if(digitalRead(digital1) == 0)   
  {
    if(millis() >= Time)                
    { 
      digitalWrite(LED, !digitalRead(LED)); 
      Time = Time + TIME;                   
    }
  }
  else                              
  { 
    digitalWrite(LED, LOW);    
muxShield.digitalWriteMS(2,15,HIGH); 
  }
}

mgr10: How can I write "constant int" for for example led on outputs (2,15)?

You can't. You'll need two variables there. digitalWrite only takes one number, the pin number. This thing takes two, the first one looks like a pin group and the second is a pin number in that group. So you'll need at least two variables.

const int ioGroup = 2;
const int pinNumber = 15;

muxShield.digitalWrite(ioGroup, pinNumber, HIGH);

Thank you for aswer.

But is same ,like to write

 muxShield.digitalWriteMS(2,15,HIGH)

How write this with muxshield?

 {
    if(millis() >= Time)                
    { 
      digitalWrite(LED, !digitalRead(LED)); 
      Time = Time + TIME;
 {
    if(millis() >= Time)                
    { 
      muxShiled.digitalWriteMS((2,15)!muxShield.digitalReadMS(2,15)); 
      Time = Time + TIME;

This code is crap.!