I have a new project, adding TFT extensions to Arduino’s uLisp interpreter. In other words, I’m adding uLisp TFT commands so I can control a TFT Shield using lisp commands rather that direct C functions. The new Lisp functions are basically wrappers around the C function, which is a lot easier than re-writing them all in lisp, on the pin level. This allows to write TFT based programs in lisp, of course, and also command the shield at an interpreter prompt through the serial connection, rather than having to recompile a program.
1215> (setcolor 0 0 255) nil 1215> (dotimes (x 119) (drawline 100 200 (* x 4) 319)) nil
The project is hosted at Savannah.
I am using the KUMAN 3.5″ TFT LCD Shield. The shield does both screen drawing and touchscreen, but at present I have only implement some of the screen drawing functions. I initially wanted to use a UNO instead of a MEGA2560, but I wanted something with more memory if I was going to try combining uLisp and the TFT related libraries.
Shortly after getting enough functions to draw on the screen, I wrote a lisp program to draw Next Nearest Neighbor fractals. Having less that 1600 bytes of spare memory to work with I had to be extra careful even buffering a single line of pixel data, packing sixteen pixels into each sixteen bit integer. I wanted to post a cool photo of that, but for some reason the program keeps running out of memory, even when I’m using aggressive garbage collection. It seems like the procedures I wrote shouldn’t be using that many bytes, but apparently I’ll have to review that some more.
3 thoughts on “New Project: uLisp-TFT”
Cool project, how is the current status of your project?
Shortly I added some features to uLisp to support the ESP-WROOVER-Kit, an esp32 board with a 3.5 inch 320×240 px TFT, sd-card slot and 4MB PSRam (usable as uLisp workspace!). The board is available at Mouser, Olimex and other distributors for around $40.
The TFT displays the REPL and you can draw pixels with a (plot x y color) function. More graphic functions can be added easily because I used the Arduino TFT_eSPI library to support the TFT.
You can connect a PS2 keyboard to the board to get a stand alone lisp machine (including parentheses highlighting) (many USB keyboards (in PS2 mode) should work too).
It’s still a work in progress, but most features should work as they do in standard uLisp (uLisp V. 2.5c ist ready for download, uLisp V. 2.6 comming soon)!
For more information and downloads have a look at https://GitHub.com/kaef and look at the uLisp forum at http://uLisp.com/ (there’re a few topics depending my uLisp esp32 extensions).
Hi, to be honest I haven’t worked on ulisp-tft itself for some time, but I believe I had all the TFT display functions mapped to ulisp functions. But I had not started on any of the TFT input (touch sensing) functions.
I did use the existing functions recently in a little project (https://librehacker.com/2019/03/16/harmongrams-on-arduino-via-serial-commands/) to draw things on the TFT remotely over the USB serial connection, with the drawing controlled by a Racket program doing calculations that would have been too much for the arduino to handle.
My thought is that honestly it is just not practical to write large, impressive programs in uLisp to run on the arduino, due to the limitations of uLisp and the limitations of the arduino memory. But I think it is a useful and interest paradigm to have basic interface functions available from a uLisp interpreter running on the arduino, and then have that controlled remotely by some more powerful “mother brain” on the network.
Anyway, I hope to get around to the TFT input functions soon but my life is pretty busy at the moment.