title: Arduino Digital Pins HIGH LOW output seem to be reversed
body: <p>I've written a code last year which was working well at that time. However on loading the same code this time I am getting reversed output. That is, when the Digital Pin is set to HIGH, it return LOW and vice versa.</p>
  
  <pre><code>digitalWrite(led, HIGH) //PROBLEM: Should turn ON the LED but insted it turns OFF
  </code></pre>
  
  <p>I've tried the BLINK EXAMPLE and in that case also the output seem to be reversed.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>// Pin 13 has an LED connected on most Arduino boards.
  // give it a name:
  int led = 13;
  
  // the setup routine runs once when you press reset:
  void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
  }
  
  // the loop routine runs over and over again forever:
  void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(5000);               // wait for a second
  }
  </code></pre>
  
  <p>According to the code, my LED should be turned ON for 1 second and then should be turned OFF for 5 seconds before it again turns ON. However, the OUTPUT I am getting is completely reverse i.e LED is ON for 5 seconds and OFF for 1 second.
  I need help how to fix this.</p>
  
  <p>My main code is based on interfacing arduino with android. I have been working on to fix this for android-arduino connectivity via bluetooth, which I did accomplish last year but now have encountered this issue.
  I have tried this on three different arduino uno boards, tried with different sensors but the HIGH-LOW seems to be reversed.</p>