TTGO T-Display setup and speed problem


I’m following these instructions to set up ulisp on a TTGO T-Display.

I have got the latest esp32 boards installed (v2.0.9) and have selected the ESP32 Dev Module as the board.

When I try and compile ulisp (ESP Release 4.4c) I get the following error:

ulisp-esp/ulisp-esp.ino:5471:29: error: 'LED_BUILTIN' was not declared in this scope
   { string226, (fn_ptr_type)LED_BUILTIN, 0, NULL },
ulisp-esp/ulisp-esp.ino:5471:29: note: suggested alternative: 'BUILTINS'
   { string226, (fn_ptr_type)LED_BUILTIN, 0, NULL },

exit status 1

Compilation error: 'LED_BUILTIN' was not declared in this scope

I tried to fix this using the suggestion in this comment, adding near the top of the file:

#define LED_BUILTIN 13

The program then compiles and I can deploy it to the device. However, when I run something simple like a fill-screen command, it takes a second or so to actually fill the screen with the colour, it slowly writes to the colour to the screen a row at a time.

From youtube videos that I’ve seen (not using ulisp) people are able to draw to the screen very quickly, playing games etc on it. This makes me think that I’m doing something wrong or don’t have it set up correctly. Are these issues related at all?


Yes, that’s the correct fix for LED_BUILTIN. In a future version I’ll probably make it automatic.

Running graphics written in Lisp will be slower than the equivalent C, but the uLisp fill-screen command just calls the C function, so I would expect it to be the same speed.


Thanks @johnsondavies.

This is what I’m seeing with the program:

(defun main ()
  (fill-screen orange)
  (fill-screen red)
  (fill-screen orange)
  (fill-screen red)
  (fill-screen orange)
  (fill-screen red)
  (fill-screen orange)
  (fill-screen red)) 


Maybe I’ve misunderstood what fill-screen does? I’ll check out the C code. I’ll also try doing some things directly in C and see if I can write to the screen more quickly


In this video that I found on Youtube the C function fillScreen seems to fill the screen instantly on the same board.

I wonder where the difference is coming from?


Sorry all the messages, just logging things here as I find them out.
I uploaded the sketch from here and my display behaves in the same way as shown in this video.

Maybe it’s the behaviour of the Adafruit_GFX library that the fillScreen does a “wipe” fill rather then filling instantly.


So do you think the difference is explained by the TFT_eSPI library vs. the Adafruit GFX library?


It appears to be. I’ve got the TFT_eSPI library running on a board now and a fillScreen is instant with no wipe. I what I haven’t figured out yet is whether the “wipe” behaviour of the Adafruit GFX fillScreen function is intentional or not.


More likely that the TFT_eSPI library is faster because it’s using a faster SPI interface. It would be interesting to compare another command, such as:

(fill-circle 66 66 66)

or the C equivalent, using both libraries.