title: RuntimeError: You must setup() the GPIO channel first
body: <p>When i execute with sudo python3 program.py and press de switch 1 throws the next exception: </p>
  
  <pre><code>Taking picture...
  Picture takeng...
  Traceback (most recent call last):
    File "main.py", line 21, in &lt;module&gt;
      if GPIO.input(switch1):
  RuntimeError: You must setup() the GPIO channel first
  </code></pre>
  
  <p>I use a raspberry cam library and rpi.gpio library for this project. Anyone knows what happend in my code ?</p>
  
  <pre><code>import RPi.GPIO as GPIO
  import time
  import picamera
  
  # initial config for gpio ports
  GPIO.setwarnings(False)
  GPIO.setmode(GPIO.BCM)
  
  # input switches
  switch1 = 22
  switch2 = 23
  switch3 = 24
  
  # setup
  GPIO.setup(switch1, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  GPIO.setup(switch2, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  GPIO.setup(switch3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  
  # main loop
  while True:
      if GPIO.input(switch1):
          print ("Taking picture...")
          with picamera.PiCamera() as camera:
              camera.resolution = (1280, 720)
              camera.start_preview()
              time.sleep(0.5)
              camera.capture("test.jpg")
          print ("Picture takeng...")
      elif GPIO.input(switch2):
          print ("Taking video...")
      elif GPIO.input(switch3):
          print ("Poweroff...")
          break
  
  GPIO.cleanup()
  </code></pre>