ESP32: Testing uLisp

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.

Introduction

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.

The tests from this tutorial were performed using a DFRobot’s ESP32 module integrated in a ESP32 development board.

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.

uLisp Arduino file on the GitHub repository

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.

uLisp prompt on the Arduino IDE serial monitor

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.

uLisp hello world command on the prompt

Figure 3 – “Hello world” command in uLisp.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s