     } while( status != 0 && retries-- > 0);
 
     if(status == 0) {
-      Serial.println("Status = 0");
+      Serial.println("Status = 0, setting Mode1 and Mode2");
         Wire.beginTransmission(ADDRESS);
-        Wire.write(0);      // Mode1 register
-        Wire.write(0);      // Osc on, diable AI, subaddrs, and allcall
+        Wire.write(0);      // Control register - No AI, point to reg 0 Mode1
+        Wire.write(0);      // Mode1 register: Osc on (no sleep), diable AI, subaddrs, and allcall
         Wire.endTransmission();
 
         Wire.beginTransmission(ADDRESS);
         Wire.write(1);      // Mode2 register
-        Wire.write(0x04);   // Dimming, Not inverted, totem-pole
+        Wire.write(0x04);   // Dimming, Not inverted, totem-pole (this is the default except D0)
         Wire.endTransmission();
 
     } else {
         Serial.println("Transmission failed");
     }
 
-    Wire.beginTransmission(ADDRESS);
-	  Wire.write(2);    // 2 + led #
-	  Wire.write(128);  // 1/2 brightness
-	  status = Wire.endTransmission();
-    if(status != 0){
-      Serial.println("Write failed");
-    }else{
-      Serial.println("Write succeeded");
-    }    
+    Serial.println("Turning ON all LEDS");
+    Wire.beginTransmission(ADDRESS);
+	  Wire.write(0x8c); // AI + LEDOUT0
+	  Wire.write(0x55); // LEDOUT0 All 4 LEDS ON
+	  Wire.write(0x55); // LEDOUT1 All 4 LEDS ON
+	  status = Wire.endTransmission();
+    if(status != 0){
+      Serial.println("Write failed");
+    }else{
+      Serial.println("Write succeeded");
+    }    
+
+    delay(2000);
+
+    Serial.println("Turning OFF all LEDS");
+    Wire.beginTransmission(ADDRESS);
+	  Wire.write(0x8c); // AI + LEDOUT0
+	  Wire.write(0x00); // LEDOUT0 All 4 LEDS OFF
+	  Wire.write(0xaa); // LEDOUT1 All 4 LEDS Dimming
+	  status = Wire.endTransmission();
+    if(status != 0){
+      Serial.println("Write failed");
+    }else{
+      Serial.println("Write succeeded");
+    }    
+
+//    delay(2000);
+
+    // Serial.println("Setting LED 2 = 255");
+    // Wire.beginTransmission(ADDRESS);
+	  // Wire.write(3);    // 2 + led #
+	  // Wire.write(255);  // Full brightness
+	  // status = Wire.endTransmission();
+    // if(status != 0){
+    //   Serial.println("Write failed");
+    // }else{
+    //   Serial.println("Write succeeded");
+    // }    
+
+    // delay(1000);
+
+    // Serial.println("Setting LED 2 = 0");
+    // Wire.beginTransmission(ADDRESS);
+	  // Wire.write(3);    // 2 + led #
+	  // Wire.write(0);    // Off
+	  // status = Wire.endTransmission();
+    // if(status != 0){
+    //   Serial.println("Write failed");
+    // }else{
+    //   Serial.println("Write succeeded");
+    // }    
+
+    // Repeat
+    // TODO:
 }
-
-// void loop() {
-//     bool devicesFound = false;
-//     String newDevices;
-
-//     Serial.println("Starting loop...");
-//     //Step through all 127 possible I2C addresses to scan for devices on the I2C bus.
-//     for(int i = 1; i < 128; i++){
-//         //Make a general call to device at the current address to see if anything responds.
-//         Wire.beginTransmission(i);
-//         byte status = Wire.endTransmission();
-//         if(status == 0){
-//             //Device found so append it to our device list event string
-//             // Devicess found at 1, 3, 32, 112 (0x01, 0x03, 0x20, 0x70)
-//             char devices[32];
-//             sprintf(devices, "Device at: %ix, ", i);
-//             newDevices.concat(devices);
-//             devicesFound = true;
-//         }
-//     }
-//     if(devicesFound){
-//         Serial.println(newDevices);
-//     }else{
-//         Serial.println("No devices found");
-//     }
-    
-//     delay(2000);
-// }
 
 // From TravisE_NCD_Technica
 unsigned long scanInterval = 10000;
 unsigned long lastScan;
+byte dimming = 0;
 
 void loop() {
-    if(millis() > lastScan + scanInterval){
-        lastScan = millis();
-        // bool devicesFound = false;
-        // String newDevices = "Devices at: ";
-        // //Step through all 127 possible I2C addresses to scan for devices on the I2C bus.
-        // for(int i = 1; i < 128; i++){
-        //     //Make a general call to device at the current address to see if anything responds.
-        //     Wire.beginTransmission(i);
-        //     byte status = Wire.endTransmission();
-        //     if(status == 0){
-        //         //Device found so append it to our device list event string
-        //         newDevices.concat(i);
-        //         newDevices.concat(", ");
-        //         devicesFound = true;
-        //     }
+    byte status;
+    // if(millis() > lastScan + scanInterval){
+    //     lastScan = millis();
+
+    //     bool devicesFound = false;
+    //     String newDevices = "Devices at: ";
+    //     //Step through all 127 possible I2C addresses to scan for devices on the I2C bus.
+    //     for(int i = 1; i < 128; i++){
+    //         //Make a general call to device at the current address to see if anything responds.
+    //         Wire.beginTransmission(i);
+    //         byte status = Wire.endTransmission();
+    //         if(status == 0){
+    //             //Device found so append it to our device list event string
+    //             newDevices.concat(i);
+    //             newDevices.concat(", ");
+    //             devicesFound = true;
+    //         }
         
-        // }
-        // if(devicesFound){
-        //     Serial.println(newDevices);
-        // }else{
-        //     Serial.println("No Devices Found");
-        // }
-    }
+    //     }
+    //     if(devicesFound){
+    //         Serial.println(newDevices);
+    //     }else{
+    //         Serial.println("No Devices Found");
+    //     }
+    // }
+
+    Serial.println("Turning ON LEDS 0-3");
+    Wire.beginTransmission(ADDRESS);
+	  Wire.write(0x8c); // AI + LEDOUT0
+	  Wire.write(0x55); // LEDOUT0 All 4 LEDS ON
+	  //Wire.write(0x55); // LEDOUT1 All 4 LEDS ON
+	  status = Wire.endTransmission();
+    if(status != 0){
+      Serial.println("Write failed");
+    }else{
+      Serial.println("Write succeeded");
+    }    
+
+    Serial.println("Setting LEDs 4-7 = 255");
+    Wire.beginTransmission(ADDRESS);
+	  Wire.write(0x86); // AI + 2 + led # 4
+	  Wire.write(dimming);  // Full brightness
+	  Wire.write(dimming);  // Full brightness
+	  Wire.write(dimming);  // Full brightness
+	  Wire.write(dimming);  // Full brightness
+	  status = Wire.endTransmission();
+    if(status != 0){
+      Serial.println("Write failed");
+    }else{
+      Serial.println("Write succeeded");
+    }    
+
+    delay(1000);
+    dimming += 16;
+
+    Serial.println("Turning OFF LEDS 0-3");
+    Wire.beginTransmission(ADDRESS);
+	  Wire.write(0x8c); // AI + LEDOUT0
+	  Wire.write(0x00); // LEDOUT0 All 4 LEDS OFF
+	  //Wire.write(0x00); // LEDOUT1 All 4 LEDS OFF
+	  status = Wire.endTransmission();
+    if(status != 0){
+      Serial.println("Write failed");
+    }else{
+      Serial.println("Write succeeded");
+    }    
+
+    Serial.println("Setting LEDs 4-7 = 0");
+    Wire.beginTransmission(ADDRESS);
+	  Wire.write(0x86);    // 2 + led # 4
+	  Wire.write(dimming);
+	  Wire.write(dimming);
+	  Wire.write(dimming);
+	  Wire.write(dimming);
+	  status = Wire.endTransmission();
+    if(status != 0){
+      Serial.println("Write failed");
+    }else{
+      Serial.println("Write succeeded");
+    }    
+
+    delay(1000);
+    dimming += 16;
+
 }

 *
 * History
 * 2/23/20 Initial creation
 */

#define ADDRESS  0x40  // high jumper set (address 64)

#include "Particle.h"


 *
 * To update Photon:
 *   1. Edit this code
 *   2. "particle flash RonTest"
 *
 * Hardware
 * 1. Photon
 * 2. ControlEverything.com NCD Photon Screw Terminal Breakout board
 * 3. NCD8PWM board connected via I2C to NCD STB board
 * NCD 8-channel PWM OC board with adress switches set per ADDRESS
 * LED connected to channel 0
 * 
