GPIO warning setmode

Hello I am getting a warning when I run my script. I seems to only get it when I am creating a Miniscreen instance.

RuntimeError: Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)

I have tried importing the GPIO and setting them as well as turning off the warnings with

GPIO.setwarnings(False)

Thanks in advance. I am a teacher and hate to just tell my students to ignore certain warnings.

It’s asking you to set the pin mode, BOARD and BCM refer to the GPIO pins differently and the system does not know what mode to use

https://workshop-iot-programming.devbit.be/assets/img/pinout_wiring_pi.56491fd7.png

Board refers to the physical pin locations where bcm does not

Just add GPIO.setmode (as it is in the error) at the beginning of your script depending on what mode you want to use

@twomed Please can you send us the full script you are using? I remember seeing this warning a few weeks ago when using the miniscreen and I thought we fixed it - have you ran an update recently?

Updating seems to have fixed this

2 Likes