Today I finished my What’s up (flight monitor) project by adding touch functionality to the TFT display. Touching a plane on the map will temporarily turn its icon red and display its flight details in a popup text area. After a couple of seconds, the map will be restored to full size again.
[Background conversation is live air traffic control from Amsterdam Airport Schiphol; video quality suffers from interference between the TFT display and my smartphone’s camera]
I had to use a STMPE160 touch screen controller because an esp8266 board like the Wemos only has one analog input, whereas my display needs two. Adafruit’s STMPE160 library seems to lack reliable control over the touch buffer, resulting in old touch point data being returned when a new touch event occurs. Luckily, I found a way to flush the buffer and make the sketch work.
I learned a lot from this challenging project and I’m quite satisfied with the final result. Intermediate versions of this project are here and here.
Going graphical was a logical step between my original text-based flight monitor and the final touch screen version. Here’s the result on a 480×320 TFT display, powered by an esp8266 based Wemos D1 R2. It shows spotted airplanes over the displayed area, updating their positions every 5 seconds.
The suddenly appearing fourth airplane obviously just switched on its transponder while standing on the runway of Eindhoven Airport, that’s why it doesn’t move.
Military airplanes will appear in a different color and I’m considering the use of different icons for helicopters, gliders, air balloons and UFOs…
The refresh of the airplane icons isn’t as fast as I had hoped for, especially if there are many (can’t do them one at the time because they can overlap). This HX8357D driven Adafruit 3.5″ display is great, but not exactly fast. Let’s hope someone optimizes the library one day. Anyway, I’m still quite satisfied with the overall result so far.
See also: the final touch screen version of this project. Clicking a plane temporarily shows its flight details in a popup text area.