Why you should learn to program on the Raspberry Pi

Frank Delporte
Sep 8, 2020 · 4 min read

In this article “Java vs Python — Which Programming Language Should Programmer Learn First?” by Javin Paul, you can find a comparison between the two most popular programming languages. Of course, as being a Java-developer myself, it’s not a mystery which I would prefer ;-)

But more important than the language, could be the computer you are using! Let me tell you why I think the Raspberry Pi is the perfect getting-started computer…

The goal of the Raspberry Pi project was to build an inexpensive PC that is affordable for all. You can connect it to your TV if you don’t have a computer-screen and different versions are available, depending on your budget.

Image for post
Image for post

If you want to have a quick start, buy the “Raspberry Pi 4 Desktop Kit” (130€) which includes the board, power supply, HDMI cables, case, and microSD card with the operating system pre-installed. You only need to add a monitor or TV.

Why use a Raspberry Pi?

If you already have a power supply, cables, and/or microSD card, you can buy the board itself starting from 40€. Yep, indeed, that’s the starting price for a complete PC on a small board!

There are different operating systems available for the Raspberry Pi, but the perfect starting point is provided by “Raspbian OS (full)” which can be copied to a microSD card with the free “Imager” tool.

Image for post
Image for post

When you use this OS you’re ready to start working from minute one as these tools are pre-installed:

Image for post
Image for post

I only added “Visual Studio Code” to this list myself. This program is not available through the official website in a version for Raspbian OS, but follow these steps to install it through the terminal:

$ cd /home/pi/ 
$ wget https://github.com/stevedesmond-ca/vscode-arm/releases/download/1.28.2/ vscode-1.28.2.deb
$ sudo apt install ./vscode-1.28.2.deb

Make your choice: Java, Python, JavaScript,… or start with the basics with Scratch. You can all run and use it on the Raspberry Pi.

And as you can see in the above screenshot, multiple tools are available for all these programming languages.

When you look at the Raspberry Pi board, you’ll find 40 pins (2 rows of 20). Those are the GPIOs (= General-purpose input/output). Some of those can be used as a digital input or output pin, meaning 0 Volt is off, 3.3 Volt is on. And the number of things you can do with it is amazing!

These GPIOs pins are even one of the main factors which made the Raspberry Pi such a success! As I discussed in a podcast with Adam Bien (airhacks.fm), you can indeed find a cheap second-hand laptop which includes a battery, screen, etc. but you’ll never be able to build experiments which combine soft- and hardware in such an easy way as you can do with the Raspberry Pi.

In this long article on Oracle Java Magazine you can find a detailed step-by-step for a Java application with a user interface to control a LED and show the measurements of a distance sensor on a graph.

The latest Raspberry Pi 4 is fast and available with 2, 4, or 8GB of memory. I wrote a full book on it and created a lot of different Java applications on it. You can connect up to two 4K monitors, so a lot of space to have different applications, terminal, file explorer, etc. Already one such a 4K screen is a programmer’s heaven!

Image for post
Image for post

Book “Getting Started with Java on the Raspberry Pi”

If you want to start experimenting with Java on the Raspberry Pi, I can highly recommend my book which guides you through all the steps to get started with a lot of examples.

It’s available as an ebook on Leanpub and a paper book on Elektor. If you want to dive into the sources of the examples, take a look at this GitHub repository.

If you prefer courses, there is also a course on Udemy — Use Java and Java FX on a Raspberry PI to learn more bout using Raspberry PI in Java.

Image for post
Image for post

Originally published at https://webtechie.be.

Javarevisited

Medium’s largest Java publication, followed by 9200+ programmers. Follow to join our community.

Frank Delporte

Written by

Author of ‘Getting Started with Java on Raspberry Pi’, http://webtechie.be , https://twitter.com/frankdelporte

Javarevisited

A humble place to learn Java and Programming better.

Frank Delporte

Written by

Author of ‘Getting Started with Java on Raspberry Pi’, http://webtechie.be , https://twitter.com/frankdelporte

Javarevisited

A humble place to learn Java and Programming better.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store