unable to control neopixels with ESP 01 board
Posted: Wed May 26, 2021 7:33 pm
I'm running esp8266-1m-20210418-v1.15.bin on my ESP 01
I have a cheap ws2812 strip and a ESP-01 module and LED adapter.
I can control the LEDs just fine using nodemcu / lua
But if I flash my ESP01 with micropython v1.15 (for 1M flash) I'm unable to control the LEDs at all. The first shows brite white and the second green which is how they regularly are when you apply power. Here's the lua documentation.
I've tried
or
and also
I'm using pin 2 since that's GPIO2 and that's what the lua ws2812 docs say it uses. But I've also tried passing 0,1,2,3 to Pin and none of those work either, neither does changing the last is800khz flag. I've verified that
set the output voltage on pin 2 GPIO2 as expected.
I even had a go at trying to get this SPI code to work on an ESP01 and didn't have any luck with that.
Am I doing something obviously wrong? Thanks for your help.
My board ids as
and I'm flashing it with
repl works fine as does setting a pin's output to 0 or 1
I have a cheap ws2812 strip and a ESP-01 module and LED adapter.
I can control the LEDs just fine using nodemcu / lua
But if I flash my ESP01 with micropython v1.15 (for 1M flash) I'm unable to control the LEDs at all. The first shows brite white and the second green which is how they regularly are when you apply power. Here's the lua documentation.
I've tried
Code: Select all
import machine,neopixel
p = neopixel.NeoPixel(machine.Pin(2, machine.Pin.OUT), 8)
p.fill((255,0,0))
p.write()
Code: Select all
import machine,neopixel
p = neopixel.NeoPixel(machine.Pin(2), 3)
p[0] = (255,0,0)
p[1] = (0,0,255)
p[2] = (0,255,0)
p.write()
Code: Select all
import esp, machine
esp.neopixel_write(machine.Pin(2, machine.Pin.OUT), bytearray([0, 0, 255]), True)
Code: Select all
pin = machine.Pin(2, machine.Pin.OUT)
pin.value(1)
pin.value(0)
I even had a go at trying to get this SPI code to work on an ESP01 and didn't have any luck with that.
Am I doing something obviously wrong? Thanks for your help.
My board ids as
Code: Select all
esptool.py --port $(jq -r .port .nodemcutool) flash_id
esptool.py v3.0
Serial port /dev/tty.usbserial-1420
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: f4:cf:a2:c8:37:e6
Uploading stub...
Running stub...
Stub running...
Manufacturer: 5e
Device: 6014
Detected flash size: 1MB
Code: Select all
FIRMWARE=../../thirdparty/esp8266/esp8266-1m-20210418-v1.15.bin
esptool.py --baud 460800 --port $(jq -r .port .nodemcutool) write_flash --flash_size=detect -fm dio 0 $FIRMWARE