   {
     if( !g_aPins[i].is_input ) // Process output pins
     {
-      if( g_aPins[i].is_analog ) // Process analog pins      
+      if( g_aPins[i].is_analog ) // Process analog pins     
         analogWrite(i, getTotalPinValue(i)*ANALOG_OUT_MAX_VALUE );
       else // Process digital pins     
         digitalWrite(i, getTotalPinValue(i) );
+
+      /*
+      if(i==13)
+      {
+        Serial.print("Value:");        
+        Serial.println(getTotalPinValue(i));
+      }
+      */
+              
     }
   }
   

    {
    case UP:
//      g_iNewCode = 0;      
      initBoardStateFromFile(BOARD_CONFIG_FILE_FULL_PATH);
       //      g_iWriteToFile=0;
      break;

    case DOWN:
    
      // Serial.println("Writing board state to file");
        writeBoardStateToFile(BOARD_CONFIG_FILE_FULL_PATH);
      // g_iWriteToFile=1;
    
//        system("shutdown -r now");

//------------------------------------------------------------
void initBoardStateFromFile(char* _sFullFilePath) {

  // Initialize the HW to a known state
  initBoardState();
  
  // Read HW state in from the file  
//  Serial.println("Init from board file");  
  // Open File
  FILE *fp;
