I have successfully loaded uP 1.19 on an esp01 and can get it to write text to an OLED and blink and LED if I bread board them separately:
Code: Select all
Esp-01 to OLED on bread board
https://www.instructables.com/I2C-With-the-ESP8266-01-Exploring-ESP8266Part-1/
Connect USB / FTDI programmer to esp-01 and then to OLED:
esp01 OLED
IO2 sda
IO0 scl
esp-01 pin map
https://www.theengineeringprojects.com/wp-content/uploads/2019/03/introduction-to-esp-01.jpg
Code: Select all
Esp-01 to LED on bread board
https://learn.adafruit.com/micropython-basics-blink-a-led/blink-led
(resistor not esp01 pic)
1. Use an FTDI USB programmer on the esp01
2. Connect "IO0" via female to male jumper to led on the bread board
3. Connect Led to 2k resistor
4. Connect Resistor to "IO2"
esp-01 pin map
https://www.theengineeringprojects.com/wp-content/uploads/2019/03/introduction-to-esp-01.jpg
https://www.aliexpress.com/item/3256801133502533.html?gatewayAdapt=4itemAdapt
So now, I try to combine - I guess the first question -- is that a fool's errand? I *seem* to be pretty close.
How I tried set it up:
I connect the LED to TX (pin 2 of the esp01) to the anode, or longer leg, of the LED. The cathode, or shorter leg, of the LED is connected to one side of a 2k resistor. The other side of the resistor is connected to the board's ground or GND pin.
So esp (Tx) ==> short leg LED => longer leg LED => 2k R => GRND. GRND is also connected to GRND of the OLED.
Basically following https://learn.adafruit.com/micropython- ... d/hardware
In my mind the TX should be the 'driver' that turns the led on/off and I believe it is Pin 2, based on the esp01 pin mapping above.
On boot the LED is ON, won't turn off, but when I attempt to blink:
myled = machine.Pin(X, machine.Pin.OUT)
X:
1 Lights up the led but HANGS the repl
Both 0, 4 and 5 flickers led
3 hangs Thonny entirely
6, 7, and 8 all given "ValueError: invalid pin
I don't think this means much b/c if I just hit enter in thonny , the led flickers. So really I'm just trying things b/c I don't really know what resource I should trust. Hence I tried a bunch of things, and the board only cost like 2 bucks..
I can still write to the OLED and access the 'net. Am I close or is it like I'm way off?