1) use uint8_t for the pin variables (that is what digitalWrite expects), or as they are constant better use define
2) make a function to set the values
#define PIN5 5
#define PIN6 6
void setup()
{
pinMode(PIN5, OUTPUT);
pinMode(PIN6, OUTPUT);
}
void loop()
{
setMUX(LOW, LOW);
setMUX(LOW, HIGH);
setMUX(HIGH, LOW);
setMUX(HIGH, HIGH);
}
void setMUX(uint8_t a, uint8_t b)
{
digitalWrite(PIN5, a);
digitalWrite(PIN6, b);
delay(1000);
}
Better would be to define 4 states (enumeration) the MUX can be in, and derive the (HIGH/LOW) values from that. That would make the MUX interface more abstract and it would hide the details of the implementation. In the end you wrap it in a (small) class of its own.