title: Why is my raspberry pi saying that the button is pressed
body: <p>I’m trying to create something with my bread and pi but the button is saying that it is pressed and when ever it does say that it is off the LED light blinks off then back on. I’ve tried new buttons and I feel this is a software issue</p>
  <p>This is my code</p>
  <pre class="lang-py prettyprint-override"><code>import drivers
  import time
  
  display = drivers.Lcd()
  
  import RPi.GPIO as GPIO
  
  GPIO.setmode(GPIO.BCM);
  
  GPIO.setup(19, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  
  GPIO.setup(13, GPIO.OUT)
  GPIO.output(13, 0)
  
  fanOn = False
  display.lcd_display_string(&quot;Fan: off&quot;, 1)   # Write line of text to first line of display
  
  
  try:
      while True:
          GPIO.output(13, GPIO.input(19))
  
          if GPIO.input(13) == 0 &amp; fanOn == True:
              GPIO.output(13, 0)
              display.lcd_backlight(1) #turns on backlight
              display.lcd_clear()
              display.lcd_display_string(&quot;Fan: off&quot;, 1)   # Write line of text to first line of display
              print(&quot;off&quot;)
              fanOn = False
              time.sleep(0.5)
          elif GPIO.input(13) == 0 &amp; fanOn == False:
              GPIO.output(13, 1)
              display.lcd_backlight(1) #turns on backlight
              display.lcd_clear()
              display.lcd_display_string(&quot;Fan: on &quot;, 1)   # Write line of text to first line of display
              print(&quot;on&quot;)
              fanOn = True
              time.sleep(0.5)
          else:
              continue
  except KeyboardInterrupt:
      GPIO.cleanup()
      display.lcd_clear()
  </code></pre>