Page 119 - Programming the Raspberry Pi Getting Started with Python
P. 119
program in C, use IDLE to create a file with the following contents:
Save the file, giving it the name hello.c. Then, from the same directory as that file, type the
following command in the terminal:
This will run the C compiler (gcc), converting hello.c into an executable program called just hello.
You can run it from the command line by typing the following:
The IDLE editor window and command line are shown in Figure 12-2, where you can also see the
output produced. Notice that the \n characters create blank lines around the message.
Figure 12-2 Compiling a C program
Applications and Projects
Any new piece of technology such as the Raspberry Pi is bound to attract a community of innovative
enthusiasts determined to find interesting uses for the Raspberry Pi. At the time of writing, a few
interesting projects were in progress, as detailed next.
Media Center (Raspbmc)
Raspbmc is a distribution for the Raspberry Pi that turns it into a media center you can use to play
movies and audio stored on USB media attached to the Pi, or you can stream audio and video from
other devices such as iPads that are connected to your home network. Raspbmc is based on the
successful XBMC project, which started life as a project to use Microsoft Xboxes as media centers.
However, it’s available on a wide range of platforms.
With the low price of the Raspberry Pi, it seems likely that a lot of them will find their way into
little boxes next to the TV—especially now that many TVs have a USB port that can supply the Pi
with power.
You can find out more about Raspbmc at www.raspbmc.com/about/, you can learn about the XBMC
project at www.xbmc.org. All the software is, of course, open source.