Skip to content

how do you enable BCM mode from this ext-gpio code? The default mode is Board. #3

@jacksnodgrass

Description

@jacksnodgrass

In python you can switch between BCM and BOARD mode using:

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM) 

OR

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)

how can I go into 'BCM' mode with this ext-gpio?

I'd like to be able to use:
$doorUP = $chip->getPin(17)->asInput('softwire');
or
$doorUP = $chip->getPin(GPIO17)->asInput('softwire');

instead of figuring out what the board / header / pin number is for the GPIO17 numbering structure.

I mean I can setup an array that maps the header pins to the BCM names... but do I have to do it that way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions