Das Objekt Pin: Unterschied zwischen den Versionen

Aus Attraktor Wiki

Wechseln zu: Navigation, Suche
(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...")
(kein Unterschied)

Version vom 18. Januar 2024, 21:26 Uhr

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)