Das Objekt Pin

From Attraktor Wiki
Revision as of 22:26, 18 January 2024 by Kapest (talk | contribs) (Created page with "In Python ist alles ein Objekt und Objekte haben eine ID. <pre> >>> from machine import Pin >>> print(Pin(11)) Pin(GPIO11, mode=IN, pull=PULL_DOWN) >>> b_up = Pin(11, Pin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In Python ist alles ein Objekt und Objekte haben eine ID.

>>> from machine import Pin
>>> print(Pin(11))
    Pin(GPIO11, mode=IN, pull=PULL_DOWN)
>>> b_up = Pin(11, Pin.IN, Pin.PULL_DOWN)
>>> Pin(11)
    Pin(GPIO11, mode=IN, pull=PULL_DOWN)
>>> print(Pin(11))
    Pin(GPIO11, mode=IN, pull=PULL_DOWN)
>>> print(b_up)
    Pin(GPIO11, mode=IN, pull=PULL_DOWN)
>>> x = b_up
>>> print(x)
    Pin(GPIO11, mode=IN, pull=PULL_DOWN)