Noob can't blink

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
gertmes
Posts: 3
Joined: Wed Jan 03, 2018 11:11 pm

Noob can't blink

Post by gertmes » Wed Jan 03, 2018 11:50 pm

Hi, I need help blinking the onboard LED on ESP32 DOIOT WEMOS (DEVBOARD)
link bellow says LED is GPIO 2 (Is there a way to verify?)

http://www.instructables.com/id/IOT-Mad ... -Arduino-/

I'm using putty serial connection.
Will WIFI & Bluetooth setup be the same for ESP32 boards?
thx

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4332
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
I (204) cpu_start: Pro cpu up.
I (204) cpu_start: Single core mode
I (204) heap_init: Initializing. RAM available for dynamic allocation:
I (208) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (214) heap_init: At 3FFDCD68 len 00003298 (12 KiB): DRAM
I (220) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (226) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (233) heap_init: At 4008FC7C len 00010384 (64 KiB): IRAM
I (239) cpu_start: Pro cpu start user code
I (33) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-231-gd3fbfa49 on 2017-12-29; ESP32 module with ESP32
Type "help()" for more information.
>>> import machine
>>> led = machine.Pin(2, machine.Pin.OUT)
>>> led.high()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Pin' object has no attribute 'high'
>>>

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Noob can't blink

Post by pythoncoder » Thu Jan 04, 2018 1:18 pm

Pins may be controlled via their value method as per the docs.

Code: Select all

import machine
led = machine.Pin(2, machine.Pin.OUT)
led.value(1)
led.value(0)
Peter Hinch
Index to my micropython libraries.

gertmes
Posts: 3
Joined: Wed Jan 03, 2018 11:11 pm

Re: Noob can't blink

Post by gertmes » Fri Jan 05, 2018 6:26 am

Thanks!

Post Reply