Using Lazarus and the Adafruit PiTFT Display + TouchScreen for RaspBerry Pi

I recently purchased an Adafruit PiTFT TFT/Touchscreen for my Raspberry Pi thinking I might want to use it to monitor status of a project on which I am working.

It cost $35. Not sure if I would call that reasonable given the RPI cost about the same. But it might be quite useful for debugging.

My testing of this device was very straight forward. I followed the instructions on the Adafruit website,

Rather than try and install the drivers into an existing image, I simply built a new SD card using the Adafruit O/S image. I specifically used the 2014-09-09 based image because I’ve had problems with VNC working for non-pi users.

Once the O/S was on the SD card, I inserted the display onto the header, turned on the RPI and watched the boot sequence on the display. Logging in to the pi users and typing startx to start XWindows worked reasonably well. Some stuff doesn’t like such a small screen. Still, very cool.

Once the RPI was running, I upgraded the O/S with current patches and performed my own procedure to get all of the software I normally use up and running.

I compiled the most recent version of Lazarus using Compiling the Latest Lazarus/Free Pascal for Raspberry Pi; however, unless you  need the most recent version of Lazarus, it is WAY easier to just install it from the repository. See apt-get install fpc lazarus fails on Raspberry Pi for the trick to installing if apt-get fails for you.

Once the compiler was running, I wrote a extremely simple pascal program that simply displays an OK button. I just wanted to see a form displayed and be able to press the button using the touch screen.

Sure enough, it works fine. Pressing the button is properly sensed.


So far, I have done no more than prove it should work. I want the application to run w/o the rest of the desktop and have not quickly figured that out.

This entry was posted in c-lazarus, c-rpi and tagged . Bookmark the permalink.

Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s