In this tutorial we will check how to use uLisp, a version of the Lisp programming language that can run on the ESP32. The tests from this tutorial were performed using a DFRobot’s ESP32 module integrated in a ESP32 development board.
In this tutorial we will check how to use uLisp, a version of the Lisp programming language that can run on the ESP32.
This Lisp version can be obtained here and it depends on the Arduino core since we will have to upload an Arduino Sketch containing the implementation. Upon uploading the sketch, we will be able to write Lisp code using a prompt, accessible via the ESP32 serial interface.
Uploading the uLisp sketch
As mentioned before, we need to have a previous installation of the Arduino core for the ESP32. You can check here the installation instructions of the Arduino core.
So, after that, simply go to the ESP32 uLisp repository and open the file named ulisp-esp32.ino. It should be at the root of the repository, as shown in figure 1.
Figure 1 – Arduino Sketch with the uLisp implementation.
Then, simply click the file and copy all its contents. Then, open the Arduino IDE serial monitor and paste the code there. Finally, upload it to the ESP32 board, like any regular Arduino sketch.
As mentioned, we will interact with the prompt via serial connection. So, if we look for the Serial.begin statement in the code we will check that it is working at a baud rate of 9600, which should be the one used when opening the Arduino IDE serial monitor (or any other serial tool).
After opening the serial monitor, you should get an output similar to figure 2, which shows the console interface.
Figure 2 – The uLisp prompt on the Arduino IDE serial monitor.
Testing some code
We will do a quick test just to check if everything is working. So, we will print a “Hello World” message with the following code:
(write-line "Hello World")
You should get an output similar to figure 3, which shows the message being printed to the prompt after the command is sent.
Figure 3 – “Hello world” command in uLisp.