I read here that I could toggle the state of a GPIO pin set to output in Python using the following command:
GPIO.output(LED, not GPIO.input(LED))
LED is the pin value. I can turn the LED on using the following code:
import RPi.GPIO as GPIO
LED = 17
But when I try
GPIO.output(LED, not GPIO.input(LED)), the following error is thrown.
RPi.GPIO.WrongDirectionException: The GPIO channel has not been set up or is set up in the wrong direction
Am I supposed to set up the GPIO channel differently from above or is the site I referenced posting incorrect information?