  
   This example code is in the public domain.
  */
- 
-// Pin 3 has an green LED connected on the RGB LED shield
-// give it a name:
-int UV_EN = 3;
-int UV_VAL = 2;
-int L_SCL = 6;
-int L_SDA = 5;
+int LED = 1; 
+int BATT = 6;
+int UV_EN = 5;
+int UV_VAL = 4;
+int L_SCL = 2;
+int L_SDA = 3;
 int TSL2561_ADDRESS = 0b0111001;
 int TSL2561_CMD = 0x80;
 int TSL_2561_BLOCK = 0x10;


// the setup routine runs once when you press reset:
void setup() {
  Serial.begin(9600);
  delay(1000);
  writeUv(0);
  writeBatt(100);
  writeIr(0);
  writeVis(0);
  advertisementData[9] = 0;

  pinMode(UV_EN, OUTPUT);
  digitalWrite(UV_EN, HIGH); // enable the UV meter
  Serial.println("start");
  setup_TSL2561();
  Serial.println("setup done");
  
  RFduinoBLE.deviceName="Whale";
}

// the loop routine runs over and over again forever:
void loop() {
  word uv,vis, ir;
  uv = analogRead(UV_VAL);
  batt = analogRead(BATT);
  readData(vis, ir);
  writeUv(uv);
  writeBatt(batt);
  writeVis(vis);
  writeIr(ir);

  RFduinoBLE.advertisementData = advertisementData;
  RFduinoBLE.begin();
  RFduino_ULPDelay(990);
  RFduinoBLE.end();

  digitalWrite(LED, HIGH);
  RFduino_ULPDelay(10);
  digitalWrite(LED, LOW);
}

void writeUv(word val) {
