
Sample code to read button on Shared I/O line:

    ledState = digitalRead(btn_PIN);
    pinMode(btn_PIN, INPUT);
    bntState = digitalRead(btn_PIN);  // read the Button input
    pinMode(btn_PIN, OUTPUT);
    digitalWrite(btn_PIN, ledState);  // reestablish the LED output state


Sample code to read button on Shared I/O line utilizing a "BtnEnable":
    ledState = digitalRead(btn_PIN);
    pinMode(btn_PIN, INPUT);          // set I/O pin for INPUT
    digitalWrite(BTN_ENB, HIGH);
    bntState = digitalRead(btn_PIN);  // read the Button
    digitalWrite(BTN_ENB, LOW);
    pinMode(btn_PIN, OUTPUT);
    digitalWrite(btn_PIN, ledState);  // reestablish the LED output state


Software PWM SAMPLE CODE executed regularly (e.g. 1/msec) :
    // support for 10% PWM type gradations of lighting LEDs
    ledTime++;
    for (int i=1; i<=nleds; i++) {  // provide for lighting of 0-10 levels 
      digitalWrite(led[i], (levelOn[i]>(ledTime%10)));
    }


Example Hardware Configuration code:
/********* Standard Fixture Active HIGH conf for UNO/Nano/miniPro **********
    const int button[] = {2, 3, 4, 5}; //The four button input pins
    #define PRESSED_STATE 1
    #define DIO_SHARING
    #define BTN_ENB 6
    const int nleds=4;
    const int lites[]  = {2, 3, 4, 5};     //the LED pins
    #define ON_STATE 1
/********** for testing with My old little Black-Box Project  **************/
    const int button[] = {19, 18, 17, 16}; //The four button input pins
    #define PRESSED_STATE 0
    //NO:  DIO_SHARING
    #define BTN_ENB 0
    const int nleds=8;
    #define ON_STATE 0
    const int lites[] = {2, 3, 4, 5, 6, 7, 8, 9};     //the LED pins
/*****/

