 
     ///////////////////////////////////////
     // Test receiving message
-    /*
+    
     if(g_ToggleFlag)
       snprintf(g_acMessage,sizeof(g_acMessage),g_acPin3_On);  
     else
       snprintf(g_acMessage,sizeof(g_acMessage),g_acPin3_Off);
     
     g_ToggleFlag = ~g_ToggleFlag;
-      */
-
+    
+    processMessage(g_acMessage);   
+    updateBoardState();
+    
+
+    ///////////////////////////////////////
+    /*
     // Connect/Disconnect
-    snprintf(g_acMessage,sizeof(g_acMessage),g_acConnA0_TO_3);  
-    
-    processMessage(g_acMessage);
+    switch(g_iDebugState)
+    {
+      case 0:
+        snprintf(g_acMessage,sizeof(g_acMessage),g_acPin13_On_3_Analog);  
+        processMessage(g_acMessage);
+        g_iDebugState = 1;
+        Serial.println("HERE 0");
+      break;
+      
+      case 1:
+        snprintf(g_acMessage,sizeof(g_acMessage),g_acConnA0_TO_3);  
+        processMessage(g_acMessage);   
+        g_iDebugState = 2;       
+         Serial.println("HERE 1");      
+      break;
+      
+      default:
+      
+      break;
+    }
+   
     updateBoardState();
+    */
     ///////////////////////////////////////
 
     //////////////////////////////////////////


void updateBoardState()
{
  for(int i=0; i<TOTAL_NUM_OF_PINS; i++)
  {
    if( g_aPins[i].is_input )
    {
      if( g_aPins[i].is_analog )
      {
        g_aPins[i].value = analogRead(i)/float(ANALOG_IN_MAX_VALUE);
      }
      else
      {
        g_aPins[i].value = digitalRead(i);
      }
    }
    else
    {
      if( g_aPins[i].is_analog )
      {
        analogWrite(i, int(g_aPins[i].value*ANALOG_OUT_MAX_VALUE) );
      }
      else
      {
        digitalWrite(i, int(g_aPins[i].value) );
      }
    }
  }
}


// Get the board state and return a JSON object
aJsonObject* getJsonBoardState()

      // Print pin value after assigment
//            Serial.println("Pin Data: ");
      //      char sPinState[128];
   //   snprintf(sPinState, sizeof(sPinState), "%s,%i,%i,%f", g_aPins[i].label, g_aPins[i].is_analog, g_aPins[i].is_input, g_aPins[i].value);
    //  Serial.println(sPinState);

    }    
  }
