Aug 122015
RPi. GPIO GPIO.getmode() function

Another new RPi.GPIO feature that I discovered last week is GPIO.getmode(). This appeared in RPi.GPIO 0.5.11 and allows you to query RPi.GPIO to see whether GPIO.setmode() has been set up as BCM, BOARD, or UNSET mode. This could be useful if you are running a suite of scripts or modules which work together. GPIO.getmode() returns… -1 if GPIO.setmode() is not set 11 if GPIO.setmode(GPIO.BCM) is active 10 if GPIO.setmode(GPIO.BOARD) is active Below you can see a live python session showing what you get when you use GPIO.getmode() with different modes set… Why Did You Bother […more…]