 
 /* Analog */
 const int lightSensorPin = 0;
-const int m1Pin = 1;
-const int m2Pin = 2;
-const int m3Pin = 3;
+const int muxOutPin = 1;
 
 /* Digital */
 const int tempSensorPin = 2;
 
-// Setup a oneWire instance to communicate with any OneWire devices 
+/* Mux */
+const int muxPins[3] = {4,5,6};
+
+// Setup a oneWire instance to communicate with any OneWire devices
 // (not just Maxim/Dallas temperature ICs)
 OneWire oneWire(tempSensorPin);
- 
+
 // Pass our oneWire reference to Dallas Temperature.
 DallasTemperature sensors(&oneWire);
 

  pinMode(3,OUTPUT);
  digitalWrite(3,LOW);
  sensors.begin();
  
}

void sendRadioMessage(String s){
  char msgChar[100];
  s.toCharArray(msgChar,100);
  radio.write(&msgChar,sizeof(msgChar));
}

void loop() {

  sensors.requestTemperatures();
  temp = sensors.getTempCByIndex(0);

  String muxMessage = "";
  for(byte pin=0;pin<8;pin++){
    selectMuxPin(pin);
    int pinValue = analogRead(muxOutPin);
    muxMessage += String(pin+5) + ":" + pinValue + ",";
  }

  digitalWrite(3,LOW);
  String lightMsg = String(LIGHT_SENSOR_ID) + ":" + lightLevel;
  String tempMsg = String(TEMP_SENSOR_ID) + ":" + temp;

  sendRadioMessage(muxMessage+lightMsg+","+tempMsg);
  delay(600000);

}