Hi.
import machine
machine.ACD(0) .... works properly but
machine.Pin(25, Pin.OUT) ... gives error as Pin is not defined
WHY?
but
from machine import Pin
Pin(25, Pin.OUT) .... works
It's confuses me totally.
Do you have an answer why the error emerges?
Thx in advance.
machine.Pin(25, Pin.OUT) instead Pin.(25, Pin.OUT) gives error
Re: machine.Pin(25, Pin.OUT) instead Pin.(25, Pin.OUT) gives error
The proper use is:
machine.Pin(25, machine.Pin.OUT)
You imported machine, not Pin. Thus you have to use the full specifier. That's the way Python works.
machine.Pin(25, machine.Pin.OUT)
You imported machine, not Pin. Thus you have to use the full specifier. That's the way Python works.