Open esp32simulator.
Create the folder "blinky" in the directory "esp32projects". Create "main.py", "diagram.json" inside the folder "blinky".
Connect all components with wires in the same way, as in the picture. You can rotate a component by pressing Ctrl+R. The resistor must be connect to D15. Pay attention to LED, since it emits light only if it's connected correctly. The current must go from an anode to a cathode (LED will not emit light if you connect it in the opposite direction).
- blinky.png (40.55 KiB) Viewed 2244 times
Paste the next code to main.py (you may click the button Select Al and press Ctrl+С (to copy the code from the forum) and Ctrl+V (to paste the code)).
Code: Select all
from machine import Pin
from utime import sleep
led = Pin(15, Pin.OUT) #makes Pin 15 an output
while True:
led.on() #turns on LED
sleep(2) #time delay 2 seconds
led.off() #turns off LED
sleep(2)
Click the green button to run the project.
You should see a blinking LED.
Save your project to the local folder "blinky". Copy-paste the code from the files "main.py", "diagram.json" in the simulator to your local files. Make a screenshot of the circuit and save the screenshot to the folder "blinky".
Whenever you want to continue programming you can copy-paste the code from the local files to your simulator (Note. The circuit is stored in the file "diagram.json", you don't need to make a new circuit all the time).