0

I was working with a very simple code: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(24,GPIO.OUT) GPIO.output(24,GPIO.HIGH)

But after running one time when I am running the code nect time the Thonny IDE is showing me RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(24,GPIO.OUT)

Why is this happening?

2

The GPIO is still working, it's the software refusing to continue without a warning unless you correct the condition causing the warning.

Either do what the warning message says or add the following line at the (logical) end of your script.

GPIO.cleanup()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.