  
 }
 
+boolean reconnect() {
+  if (client.connect("arduinoClient")) {
+    // Once connected, publish an announcement...
+    client.publish("outTopic","hello world");
+    // ... and resubscribe
+    client.subscribe("inTopic");
+  }
+  return client.connected();
+}
 
+boolean reconnect() {
+  if (client.connect(IOTID, IOTUSERNAME, IOTPASSWORD)) {
+  client.publish(STATUS,"hello world - authenticated!!");
+  client.subscribe(TOPIC);
+  }
+  
+  return client.connected();
+}
 
 void setup()
 {

  pinMode(out4, OUTPUT);
  pinMode(out6, OUTPUT);
  

  if (client.connect(IOTID, IOTUSERNAME, IOTPASSWORD)) {
   client.publish(STATUS,"hello world - authenticated!!");
   client.subscribe(TOPIC);
  }
  lastReconnectAttempt = 0;
}



#define IOTID USERNAME"/"IOTDEVICE

IPAddress server(190, 97, 169, 126);
long lastReconnectAttempt = 0;


void callback(char* topic, byte* payload, unsigned int length);
