← index #5513Issue #4286
Off-topic · high · value 0.550
QUERY · ISSUE

Pin(16,Pin.OUT) constructor changes state on ESP8266

openby coryallegoryopened 2020-01-10updated 2020-03-03
port-esp8266

Hardware used: Amica NodeMCU v2
Build: esp8266-20191220-v1.12.bin

If the value parameter is not defined when calling the Pin's constructor/init method, the state of the pin peripheral is not supposed to be affected.
http://docs.micropython.org/en/v1.12/library/machine.Pin.html

On my particular test device, there is an LED on gpio 2 and 16. 2 works as expected, however when initializing a Pin instance on gpio16 (on the ESP-12E), its value is changed.

REPL calls to reproduce:

>>> from machine import Pin
>>> led = Pin(16, Pin.OUT, value=0)
>>> print(led.value())
0
>>> led = Pin(16, Pin.OUT)
>>> print(led.value())
1
>>>

I would not expect the value to change to high=1 when no value is set.

CANDIDATE · ISSUE

can not use onboard LED esp32

closedby ghostopened 2018-11-02updated 2018-11-02

Hello.

I got ESP32 from azdelivery. It has one onboard led(D1). After installing micropython, its used as uard led?
If i try to set the D1 like usual - machine.Pin(1, machine.Pin.OUT) - the led lits up and device freezes.

Is ther something i can do?

Thanks.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied