|
// Show How to Setup ESP32 Simulation
|
|
// Show How to Setup ESP32 Simulation
|
|
// Read Values
|
|
// Read Values
|
|
// Feedback via LED |
|
// Feedback via LED
|
|
\ No newline at end of file |
|
|
|
|
|
# Simulate an ESP
|
|
|
|
|
|
|
|
> Wokwi is an online simulation tool for IOT hardware. This enables us to test out some code snippets, without the need of the real hardware.
|
|
|
|
|
|
|
|
## 1st Steps in Wokwi
|
|
|
|
|
|
|
|
Visit [https://wokwi.com/](https://wokwi.com/). There is no need to create an account, unless you want to save your projects.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
> Now you can choose which microcontroller you want to simulate. Choose the ESP32.
|
|
|
|
|
|
|
|
> A new page will open, where you can open sample projects, that are saved on the WokWi page. Take a look at these projects.
|
|
|
|
|
|
|
|
> :bulb: Code can be written in the left window. The right upper panel, lets you move and add hardware to your microcontroller. The right bottom panel is used as the serial monitor.
|
|
|
|
|
|
|
|
### Create your own Project.
|
|
|
|
|
|
|
|
> :books: Create an empty project and add some simple hardware components. (an LDR (photoresistor), an LED, a resistor od 470Ohm, and a button)
|
|
|
|
|
|
|
|
> :books: Try to read the values of the Light Depending Resisitor (LDR) and paste it in the Serial Monitor! :bulb: look up the function analogRead(), be careful which Pin you choose as input pin!
|
|
|
|
|
|
|
|
:bulb: You can change the light intensity that hits the LDR, by clicking onto it!
|
|
|
|
|
|
|
|
> :books: Connect the LED via a resisitor to the microcontroller. ( :warning: pay attention to the polarity ) and try to control the intensity of the LED in the code. :bulb: look up the function analogWrite()
|
|
|
|
|
|
|
|
> :books: Change your code, in order that the intensity on the LDR detemines the light intensity of the LED!
|
|
|
|
|
|
|
|
> :books: Add a pushbutton. The functionality of the LED should remain the same, but it should only light up, when the Button is being pressed! ( :bulb: digitalRead() )
|
|
|
|
|
|
|
|
|
|
|
|
Do you need [help](https://wokwi.com/projects/405280861526418433)? |
|
|
|
\ No newline at end of file |