Run Processing programs on your touchscreen RPi2

Lead Image © Studiostocks, 123RF.com

In Touch

We show how to get started with the Processing language on a Raspberry Pi 2 with a touchscreen.

I do a lot of hardware prototyping projects on Arduinos, the Raspberry Pi, and Linux notebooks, so you can imagine my excitement when a 3.5-inch PiTFT touchscreen [1] arrived in the mail from Adafruit. How great would it be, I thought, to use a compact portable touchscreen for interaction with the Raspberry Pi 2 (RPi2) instead of being hooked up to a big-screen monitor and its bulky HDMI cable? I'm not talking about just a framebuffer display, but rather a regular X Window desktop complete with a touchscreen and small, special-purpose applications.

The Processing language [2] works well on my Linux notebook, so I thought that sticking with a similar framework made sense for the Raspberry Pi, as well. Processing offers a rich set of easy-to-use functions and tons of additional libraries for generating graphical user interfaces. The language was created to make it less daunting for artists, creative types, and non-programmers to build their own software.

If you've used the Arduino IDE (Figure 1), you'll be right at home with Processing. The look and feel are identical. Not only that, the IDE works the same on the RPi2, a Linux notebook, and even Windows and Macs. The syntax is the same, too. Some of the functions, of course, aren't always applicable across platforms. For example, turning an output pin "on" makes sense for the RPi2, but not so much for a Linux notebook.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content