class Pin – control I/O pins¶
A pin is the basic object to control I/O pins. It has methods to set the mode of the pin (input, output, etc) and methods to get and set the digital logic level. For analog control of a pin, see the ADC class.
Get or set the digital logic level of the pin:
- With no argument, return 0 or 1 depending on the logic level of the pin.
valuegiven, set the logic level of the pin.
valuecan be anything that converts to a boolean. If it converts to
True, the pin is set high, otherwise it is set low.
Returns a list of the alternate functions supported by the pin. List items are a tuple of the form:
Pinobjects supported by the board. Examples:
Pin.board.GP25 led = Pin(Pin.board.GP25, mode=Pin.OUT) Pin.board.GP2.alt_list()