Using REPL with our ESP32

Now that we have MicroPython installed on our microcontroller, let's get familiar with MicroPython's REPL. First, we will connect to our ESP32, and then we will run a few simple lines of code to see that it is working. To start, do the following:

  1. To connect the ESP32, click on the Connect button from the right panel. The icon resembles a chain, as shown in the following screenshot:

  1. After successfully connecting, you should see the REPL prompt in the lower panel (>>>). Let's try typing a command and see what happens. To be consistent with every other first computer language tutorial, type the following and press Enter:
print('Hello World!')

You should see Hello World! print out one line below.

  1. You can do basic math with the REPL as well. You do not need to even include the print statement. Type the following and press Enter:
4+7-9+2

You should see the answer 4 in the line below.

  1. The REPL also provides help with the language. Type the following and hit Enter:
help()

You should see a list of commands, including instructions on how to connect the ESP32 to Wi-Fi.

Now that we understand more about MicroPython, let's take a look at the hardware that runs it.