Tag Archives: Raspberry Pi

Programming Languages and Raspberry Pi

There are two programming languages that are popular for use with the Raspberry Pi computer.  The first is Scratch which is a visual programming language.  The second is Python which has a more traditional approach, with text-based language statements, and use of a text editor interface for program development.

Last year, the Rutland Tech Club hosted two Scratch programming events.  Scratch is a visual programming tool developed by MIT.  The programming language constructs resemble “Lego” blocks which can be snapped together on the computer screen to build programs.

On the Raspberry Pi computer, the Raspian Linux operating system it comes with it’s own custom version of Scratch.  This version of Scratch allows access to GPIO connections on the Raspberry Pi, which are the general purpose I/O or input/output connections.  That means you can access external input sensors and output devices which can be connected to the Raspberry Pi, via the GPIO connectors.  For example, you can instruct Scratch to read in a sensor input (i.e. motion sensor, temperature sensor, etc.) or send output command to output device (i.e. camera, LED lights, etc).

Python uses the more traditional form of programming, using text commands and statements, where the programmer must input the proper program language syntax in order to instruct the Raspberry Pi what to do.  Python is a popular computer language, which has some interesting syntax features.  Unlike other computer languages, the “if” statement (conditional, if – then – else), does not use curly braces “{” and “}” to delineate the statements within an if code block or else code block.  Instead, Python uses consistent code “indenting”.  This can make for a more readable program.  In other words, program whitespace or indenting is critical in Python, whereas in other languages, proper use of whitespace is not critical (although highly recommended for readability).

Just as in Scratch programming, you can use Python to access GPIO connections to input sensors and output devices.  The Python approach is text-based programming instead of Scratch’s visual programming method, but the same types of things can be done in both languages.

The Codecademy.com website is a good place to begin to learn Python.  The tutorials are grouped into units and also include some problem solving exercises to allow you apply what you just learned.

Whatever types of projects you want to do on your Raspberry Pi, having some knowledge of Scratch or Python programming is very helpful.

 

Advertisements

Videos From Raspberry Pi Event

Thanks to everyone who attended the Raspberry Pi Event we hosted at the Rutland Library on March 14th 2015 (Ultimate Pi Day).

Here are the videos that were shown at the presentation. The first few are from the Raspberry Pi Foundation, on their website.  The rest are from YouTube.  There are many more videos on the Raspberry Pi on YouTube, which you can easily find by searching for them.

What is Raspberry Pi?

http://www.raspberrypi.org/help/what-is-a-raspberry-pi/

San Diego (CA) school kids and Raspberry Pi

http://www.raspberrypi.org/san-diego-schoolkids-and-raspberry-pi/

Raspberry Pi Stories (links to more videos and articles)

http://www.raspberrypi.org/stories/

Raspberry Pi as seen on YouTube (more videos)

Continue reading

Next Event: 3/14, Raspberry Pi Demo with Raspberry Pie

raspberry_pi_logoOur next RTC event will be on March 14th, from 1-3PM, in the Fox Room at the Rutland Free Library.

Steve Waite and Chad Merkert will present an introduction and demonstrations of the “Raspberry Pi” from the Raspberry Pi Foundation in Britain.  The Raspberry Pi is a credit-card sized computer, for about $35, that plugs into a computer monitor or TV, and uses a standard keyboard and mouse.  With the Raspberry Pi, you can browse the internet, play HD video, make spreadsheets, word-processing docs, and play games.  According to Wikipedia article:

“The Raspberry Pi is a series of credit card-sized single-board computers developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.”

If you want, you can also use the Raspberry Pi to learn coding, or learn about the Linux operating system.  You can also make your own projects by connecting the Pi to sensors (inputs) and other devices (outputs).  Steve and Chad will demonstrate some of their projects that they built.

There is a video that answers the question, “What is a Raspberry Pi?

At our last RTC event (Hour of Code), Steve brought his Raspberry Pi.  He hooked it up to the monitor and keyboard of the “Google Hangout” station, which is the large screen on wheels in the Fox Room at the Library.  So we were able to get a quick preview of what a Raspberry Pi is.  We got thinking that this would be a good topic for our next event.

As we looked for an open day for the Fox Room, we chose March 14th.  Later we realized that March 14 (or 3.14) is a perfect day to talk about the Raspberry Pi (3.141592654…).  We then later discovered that March 14 is actually “Pi Day in the USA”, according to the online forum at RaspberryPi.org.  That forum post suggests that your Pi Day event can get bonus points if you celebrate the Pi moment of 3/14/15 at 9:26:54.

pieHowever, since our event is in the afternoon, we will celebrate the Pi moment at around 3/14 1:59PM.  That is about midway through our event, and a good time for a quick break and indulge in some Raspberry Pie.  Thanks to Steve and his wife who offered to make us some Raspberry Pie for this event.

If you are planning on coming to our next event, it would really help us if you could please RSVP by email to rutlandtechclub@gmail.com, or call 802-775-8861, and let us know how many will attend.  That will help us determine how many folks are coming, and “how much” Raspberry Pie we will need for 3/14 @ 1:59PM.

We look forward to seeing you at our next Rutland Tech Club event about the amazing Raspberry Pi computer!

Ron, Steve and Chad