Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Raspberry Pi Embedded Projects Hotshot
Raspberry Pi Embedded Projects Hotshot

Raspberry Pi Embedded Projects Hotshot: Enter the world of mechatronic systems with the Raspberry Pi to design and build 12 amazing projects

Arrow left icon
Profile Icon Sai Yamanoor Profile Icon Srihari Yamanoor
Arrow right icon
€18.99 per month
Paperback Feb 2015 250 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Sai Yamanoor Profile Icon Srihari Yamanoor
Arrow right icon
€18.99 per month
Paperback Feb 2015 250 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Raspberry Pi Embedded Projects Hotshot

Chapter 1. Hello World

It is a Hotshot custom to begin learning anything new with a Hello World example. Since we will be doing really cool things in this book, we will say "Hello World" in a unique fashion. In this project, we will use the Raspberry Pi to cause an LED light to blink. This project is directed towards those who are relatively new to the Raspberry Pi environment as a warm-up exercise. Feel free to skip ahead if you have already done this with your Pi, though we suggest you look through and make sure you haven't missed anything.

A quick introduction to the Raspberry Pi

If we search for the term Raspberry Pi over the web or open the Raspberry Pi Foundation's webpage, we will find that the Raspberry Pi is a computer that is the size of a credit card.

A quick introduction to the Raspberry Pi

Parts of a Raspberry Pi

Features of a Raspberry Pi

The Raspberry Pi Foundation (http://www.raspberrypi.org/) initially released the Raspberry Pi model B. This was followed by the Raspberry Pi model A. In 2014, the Raspberry Pi foundation released variants B+ and A+. The Raspberry Pi models A and A+ (costing 25 USD and 20 USD respectively) do not come with an Ethernet port, a USB port and 256 MB RAM. The model A+ replaced model A while the model B+ replaced model B. The model B (price: 35 USD) came with an Ethernet port, 2 USB ports, and 512 MB RAM; model B+, which supersedes model B, comes with 40 pin GPIO header as opposed to 26 in the earlier models, and has 4 USB ports and a micro SD card slot instead of the SD slot. Per the Raspberry Pi Foundation website, model B+ (as well as model A+) consumes lower power, has better audio and a better form factor, which we certainly concur with. The model A+ also comes with a 40 pin GPIO header and a micro SD card slot. The models A+ and B+ have nine more GPIO pins than their predecessors.

Note

The Raspberry Pi 2 was released after we finished writing the book. Please refer to the book's site to find out more about getting started with model 2.

The objective of this book is to build cool projects using the Raspberry Pi. We will discuss the components of Raspberry Pi from this perspective. If you are interested in finding out more about the Raspberry Pi, the Raspberry Pi Foundation's webpage has published the technical specifications of all the components.

First, we will discuss the components available on the Raspberry Pi and the use of these components in our projects. The components of the Raspberry Pi include:

  • 2 USB ports (1 USB port available in model A)
  • Ethernet port (available only in models B and B+)
  • RCA output
  • HDMI output
  • Audio output
  • Low level peripherals, which include:
    • GPIO (General Purpose Input Output)
    • UART/Serial Port (Universal Asynchronous Receiver Transmitter)
    • I2C (two wire interface)
    • SPI (Serial Peripheral Interface)

Where can I buy a Raspberry Pi?

Element14 and RS Components are the most common distributors of the Raspberry Pi in the United States. The Raspberry Pi model A was roughly priced at 25 USD, while its successor model A+ was priced at 20 USD. The model B was priced at 35 USD and the model B+ is priced at 40 USD. There are also an ever increasing number of local distributors such as Adafruit and Fry's Electronics in the US that sell the Raspberry Pi for a margin. Please check the Raspberry Pi Foundation website and other sources for more vendors.

Requirements to get started with the Raspberry Pi

In this section, we will discuss the items required to get started with the Raspberry Pi. We will need all the same things that are required to use a computer/laptop. They are:

  • Display
  • Keyboard
  • Mouse
  • Wi-Fi Adapter / Ethernet cable

Note

It is possible to use the Raspberry Pi via remote login using a secure shell. This might seem difficult to those who are new to the Linux environment. The setup of the Raspberry Pi for remote login is explained in Project 13, Tips and Tricks.

The Raspberry Pi eLinux wiki (http://elinux.org/RPi_Hub) has listed peripherals that have been tested and confirmed to have worked on the Raspberry Pi. You have the freedom to choose peripherals according to your choice.

  • Display: The Raspberry Pi is provided with an HDMI output and an RCA output. It is possible to connect a monitor that has an HDMI input. It is also possible to connect monitors that have a DVI input with an HDMI to the DVI cable.
  • Power supply: Since the Raspberry Pi consumes 700 mA for its operation, it is recommended that the reader uses powered USB hubs to use devices such as Wi-Fi adapters as opposed to plugging in devices such as the Wi-Fi adapters directly to the USB port of the Raspberry Pi to avoid the device resetting itself.

Operating systems on the Raspberry Pi

The Raspberry Pi foundation recommends the following operating systems on the Raspberry Pi. They are:

  • Raspbian
  • Arch Linux ARM
  • RISC OS

You are welcome to choose any operating system of your choice. For beginners, we strongly recommend the Raspbian OS for projects. The Raspbian is equipped with tools to get started easily. The Raspberry Pi's firmware is implemented such that the operating system is loaded from an SD card.

Getting started with Raspbian

In this section, we will download an image from the Raspberry Pi Foundation's webpage to a computer, flash an SD card with the image, and set up the operating system on the Raspberry Pi. We will also try to write and execute our first example.

Downloading Raspbian

The latest Raspbian image is hosted on the Raspberry Pi Foundation's webpage (http://www.raspberrypi.org/downloads/). The latest image at the time of writing this book was Raspbian wheezy. We need to download the image and extract it to the folder of our choice.

Downloading Raspbian

Raspbian wheezy on the Raspberry Pi Foundation's website

Flashing image on to the SD card

We will discuss flashing the SD card with the Raspbian image on both Windows and Linux machines.

Windows

Extract the files to a location of your choice. The Win32DiskImager tool is required to prepare the SD card with the Raspbian image.

Tip

A standard Raspbian image is about 1.8 GB big. It is strongly recommended that you use an SD card that is at least of 4 GB big.

Windows

The Win32DiskImager tool

We can flash the SD card in three simple steps (as shown in the preceding screenshot):

  1. Select the SD card that needs to be flashed.
  2. Select the Raspbian image location.
  3. Click on Write.
  4. Click on Yes to confirm.
    Windows

    Confirm overwriting the SD card

  5. It can take a while before the write cycle is completed.
    Windows

Linux

There are two identical methods to flash an SD card on a Linux machine. The two approaches include:

  • A GUI-based approach
  • A command-line interface-based approach
A command-line interface-based approach

The SD card can be flashed in three simple steps using a command-line interface. These steps are as follows:

  1. Identify the SD card mount point.
  2. Unmount the SD card.
  3. Flash the SD card.
Identifying the SD card mount point

As soon as we insert the SD card into a USB card reader or an SD card slot found on a laptop, we need to open a terminal on our Linux machine. We need to identify our device's mount point on the machine using the following command:

df –h

The devices enumerated on the machine will be listed as shown in the following screenshot:

Identifying the SD card mount point

Storage devices identified by the operating system

Unmount the SD card

In the previous example, the /dev/sdb5 path is the storage device of interest. There may be more than one storage device that might be connected to a machine. We need to make sure that we have identified the right device. Once we have identified the device, it has to be unmounted using the following command:

umount /dev/sdb
Flash the SD card

Now, we will flash our SD card using the following command:

dd bs=4M if=~/2012-09-18-wheezy-raspbian.img of=/dev/sdb

The if= argument points to the location of the image and of= refers to the SD card mount point. The write operation takes a while to complete and it is ready for use on the Raspberry Pi upon completion.

GUI-based approach

On a Debian Linux-based operating system, there is a package called usb-imagewriter. The ImageWriter package performs the same operations required to flash an SD card.

GUI-based approach

A USB ImageWriter on Ubuntu

Setting up the Raspberry Pi

Now that the image is flashed, let's get started with setting up the Raspberry Pi for the first time. We will have to insert the SD card slot found on the other side of the Raspberry Pi.

Setting up the Raspberry Pi

A flashed SD card in the slot

When the keyboard and the mouse are connected, we can get started by powering up the Raspberry Pi!

Once the Raspberry Pi is powered up, the operating system boots up to Raspi-config. The raspi-config is the tool used to set up desktop options, keyboard settings, storage settings, and so on. The Raspi-config screen is shown in the following screenshot:

Setting up the Raspberry Pi

The Raspi-config screen

In this section, we will discuss each feature of the raspi-config tool:

  • info: As the name suggests, this section gives the general information about the tool.
  • expand_rootfs: While the SD card is flashed with the operating system image, the SD card is partitioned just about the size of the image. This command aids to expand the partition so that the remaining space can be used for file storage.
  • overscan: This is an option used when the Raspberry Pi is connected to the television.
  • configure_keyboard: This option is used to configure the change_type option of the keyboard.
  • change_pass: The default password is raspberry, and if necessary, this option lets you switch to a stronger password.
  • change_locale: The option lets you change the language preferences.
  • change_timezone: We can set our current time zone using this option.
  • memory_split: This option lets us split the memory between the ARM processor's CPU and the graphics processor.
  • overclock: The default clock speed is 700 MHz. This option lets you set the clock speed to 1 GHz. This might vary for Raspberry Pi 2.
  • ssh: This option enables the secure shell server. This is required to remotely log in the Raspberry Pi and control devices remotely. It is enabled by default on Raspbian.
  • boot_behaviour: This option enables you to boot directly into the desktop.

    Tip

    It is important that you enable this option on as the default option boots into a normal text-based console.

  • update: If the Raspberry Pi is connected to the Internet using an Ethernet cable, the raspi-config tool downloads any package that might be available.

Once we complete the setup process by selecting Finish, the Raspberry Pi reboots and expands the filesystem if necessary.

Mission briefing

In this project, we will set up the GPIO (General Purpose Input Output) peripheral on the Raspberry Pi and write our first program to cause an LED to blink. At the end, we will repeat the same steps with a Raspberry Pi add-on board called PiCrust. This will allow you to get your feet wet and ensure you have all the right tools going forward, and should you need to, troubleshoot any problems you might identify.

Why is it awesome?

Think of saying "Hello World" as both a nod to programming tradition and a dry run to ensure you are well equipped!

Your Hotshot objectives

The objectives for this mission are quite simple, and yet take us all several milestones further! Here are the objectives of the Hello World mission:

  • Collect all the necessary tools
  • Set up the GPIO peripheral
  • Introduce ourselves to the Raspberry Pi environment
  • Turn a light emitting diode (LED) on and off with a 1 second delay

Mission checklist

Go over the previous sections, and make sure you have all the tools. Download the GPIO libraries, and ensure you can log in to the Raspberry Pi remotely, and you are all set!

Note

There are two different ways to use a Raspberry Pi. They are:

  • Connecting a monitor to the HDMI port or the RCA jack and a keyboard to the USB port of the Raspberry Pi.
  • Remotely logging into the Raspberry Pi from the reader's workstation.

If you are a beginner, it is best to use the first method while the second method can be used if you are familiar with the Linux operating system and remote login capabilities.

Once we complete the setup process by selecting Finish, the Raspberry Pi reboots and expands the file system if necessary.

Hunting and gathering

As stated before, you will need to make sure you have all the tools. So, go ahead, hunt and gather away. Grab at least one of each of the following and more than one of each, if you, like us, are prone to accidents:

  • A laptop to download the Raspberry Pi image and set up everything
  • Raspberry Pi—Model B/B+ (preferred), a keyboard, and a mouse for the Raspberry Pi (optional)
  • SD card with 4GB memory (SD card preparation was explained earlier in this project)
  • USB Power Adapter (Rated 1.0 A) and Micro USB power cable
  • Ethernet cable
  • Wi-Fi adapter—(optional) refer to the eLinux wiki for Raspberry Pi for verified peripherals
  • Breadboard
  • Jumper wires
  • Discrete Resistor Values
  • A work bench (or a clean working surface—hopefully you have one)
  • Good thoughts and a can-do attitude
  • Lots of coffee, tea, or a safe beverage of your choice

Engage thrusters

You will need all of the tools listed in the previous section to get through this project. Take your time and make sure you have everything handy!

Objective complete – mini debriefing

Do you have all the tools? Ready to go? Then on to the next task!

Setting up the GPIO

We need to enable the GPIO peripherals in our Raspbian installation to get started. In order to download the required tools and set things in motion, the Raspberry Pi needs to be connected to the Internet.

The GPIO pin is a pin that is available from the Raspberry Pi's processor that enables interfacing input and output devices to the Raspberry Pi. In this section, we will talk about setting up the GPIO for interfacing an output device. There is a 26-pin interface (40 in Model B+) available on the Raspberry Pi and about 17 of those 26 pins are GPIO pins (26 of them in Model B+) while the others are miscellaneous pins such as power. The pins are driven by a 3.3 V rail and each GPIO pin is rated for about 17 mA and the total current draw not exceeding 50 mA.

Engage thrusters

We also need to know the GPIO peripherals available to conduct our experiment. The following figure shows the GPIO maps of the Raspberry Pi Rev 1 and Rev 2:

Engage thrusters

GPIO map for Models A, B, and B+. (Image published with permission from Raspi.tv)

The letter P1 shown in the following image corresponds to P1-1 of the GPIO map. P1-1 corresponds to the first pin on the left in the front row, while P1-2 corresponds to the first pin on the left in the back row.

Engage thrusters

The Raspberry Pi GPIO peripheral

In this book, we will be mostly using Python programming language. Python is a very simple and easy language to learn. We may wander off to other programming languages from time to time, but we will mostly stick to Python. With this in mind, let's get started.

Installing GPIO libraries

There are a lot of libraries available to access the GPIO peripheral. The easiest to install and use is the quick2wire python API. The API is used to control the GPIO peripherals and I2C devices connected to the Raspberry Pi.

Note

There are different libraries such as the RPi.GPIO, Pi4J, and so on. We are using the quick2wire API in this example as a beginner might find it easy to use. You are welcome to use other libraries of your choice. The quick2wire-gpio-admin tool enables controlling the GPIO pins without root access.

One disadvantage of using the quick2wire module is that it provides access only to GPIO pins 0 through 7.

The terminal can be located in the left corner of the desktop and has been highlighted in the following screenshot:

Installing GPIO libraries

A Command-line terminal on the Raspbian desktop

  1. The quick2wire library installation is based on a post on the quick2wire website (http://quick2wire.com/articles/how-to-add-quick2wire-as-a-raspbian-software-source/). In order to install the quick2wire-python library, the repository needs to be added to /etc/apt/sources.list.
    • In the command line, the repository is added by using the nano text editor:
      sudo nano /etc/apt/sources.list
      
    • The following lines need to be added to the file:
      # Quick2Wire Software
      deb http://dist.quick2wire.com/raspbian wheezy main 
      deb-src http://dist.quick2wire.com/raspbian wheezy main
      
    • The file can be saved by typing CTRL+X. The file can also be saved by pressing Y key while exiting the editor.
    • Alternatively, the lines can be added using a graphical text editor such as, leafpad and saving it:
      sudo leafpad /etc/apt/sources.list
      
  2. In order to ensure that the packages are downloaded from the quick2wire repository, we need to authenticate the packages using a key available from quick2wire:
    wget https://raw.githubusercontent.com/quick2wire/quick2wire-software-users/master/software@quick2wire.com.gpg.key
    sudo apt-key add 
    software@quick2wire.com.gpg.key
    
  3. The cache is updated and the latest software packages can be downloaded as follows:
    sudo apt-get update
    sudo apt-get upgrade
    
  4. The quick2wire tool is installed as follows:
    sudo apt-get install quick2wire-gpio-admin
    sudo apt-get install quick2wire-python3-api
    

Objective complete – mini debriefing

Now, wasn't that easy? Let's get more familiar with the GPIO input/output operations.

GPIO programming using Python

In this section, we will ensure that the library is correctly installed and add the user to the group. This will enable the user to use the GPIO pins without having root privileges. This will be followed by the section on getting started with GPIO control programming in Python.

Engage thrusters

In order to get started with programming in the Raspberry Pi, we will launch Python IDLE3 from the desktop.

Engage thrusters

Launching IDLE3 from the desktop

  1. Now, we have to get started with programming the LED blinking example in IDLE3.
  2. This LED blinking sample code is as follows:
    from time import sleep
    from quick2wire.gpio import pins, Out
    
    with pins.pin(7, direction=Out) as out_pin:
        while True:
            out_pin.value = 1 
            sleep(1)
            out_pin.value = 0
            sleep(1)
    out_pin.unexport()
  3. We will import the sleep class from the time module in the first line. This is required to introduce a 1-second delay between turning the LED on and off every other second:
    from time import sleep
    
  4. We also need the pin class from the quick2wire GPIO library:
    from quick2wire.gpio import Pin
  5. We need to set the output pin that we will be using in the example:
    LED_output = Pin(8, Pin.Out)
  6. We can set the pin to the logical high (3.3 V) as follows:
    LED_output=1
  7. We will set the pin to the logical low (0 V) as follows:
    LED_output=0
  8. We will execute the same thing using an infinite while loop:
    while True:
        LED_output=1
        sleep(1)
        LED_output=0
        sleep(1)
  9. This will make the LED blink with a 1-second delay. We should also note the indent on the blink sequence. The blink sequence has a different indent compared to the while loop. Hence, the code that is at a different indent is executed infinitely.
  10. When the program is interrupted (by pressing CTRL + C on the keyboard), we need to unexport the pins at exit:
    out_pin.unexport()

An alternative to quick2wire – RPi.GPIO

  1. Another alternative is to use RPi.GPIO (https://pypi.python.org/pypi/RPi.GPIO). It comes as a standard package along with the Raspbian Wheezy OS. Let's perform a quick review of the code:
    import RPi.GPIO as GPIO
    from time import sleep
    
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(8,GPIO.OUT)
    
    GPIO.output(8,GPIO.LOW)
    
    while True:
        GPIO.output(8,GPIO.HIGH)
        sleep(1)
        GPIO.output(8,GPIO.LOW)
        sleep(1)
    
    GPIO.cleanup()
  2. After importing the required modules, we get started with setting up the pin numbering mode. There are two types of pin numbering modes, namely:
    • The BCM Pin numbering mode: The pin numbers are based upon the pin numbers of the BCM chip.
    • The Board numbering mode: The pin numbers are based upon the pin numbers of the Raspberry Pi GPIO header.
    • In this example, we will set the BCM numbering mode and set pin 8 as the output:
      GPIO.setmode(GPIO.BCM)
      GPIO.setup(8,GPIO.OUT)
  3. We can set the pin to logical high (3.3 V) as follows:
        GPIO.output(8,GPIO.HIGH)
  4. We can set the pin to logical low (3.3 V) as follows:
        GPIO.output(8,GPIO.LOW)
  5. Now, the LED can be made to blink with a 1 second delay:
    while True:
        GPIO.output(8,GPIO.HIGH)
        sleep(1)
        GPIO.output(8,GPIO.LOW)
        sleep(1)
  6. When the program is interrupted by typing CTRL + C, we have to clean up and release any occupied GPIO resources:
    GPIO.cleanup()

Objective complete – mini debriefing

In this section, we finished writing a program to make an LED blink. In the next section, we will put a circuit together that makes an LED blink.

Electrical output of our program

In the previous section, we wrote a program to make an LED blink. Let's look at the electrical connection to observe the output of our program. We will connect a resistor between the GPIO pin and the anode of the LED. We will connect the cathode to the ground pin of the Raspberry Pi.

Engage thrusters

We will connect the LED and the resistor to the GPIO pin and the ground pin, as shown in this image:

Engage thrusters

LED blinking circuit

Note

If we are not careful with the handling of the Raspberry Pi GPIO pins, it may either temporarily reset the Raspberry Pi or sometimes even permanently damage the GPIO pin. There are several tutorials in basic electronics available over the Web. It is important that you familiarize yourself with the basics of electronics.

Once we connect the circuit as shown in the preceding image, we will be able to execute the program and conclude our experiment.

We can execute the program by running the module, as shown in the following screenshot:

Engage thrusters

Executing the Python example

Objective complete – mini debriefing

That's it! We have wet our feet by saying Hello World by blinking an LED! On our way to bigger and better things, let's stop and examine the Pi Crust for a moment.

Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi

Now that our Hello World example is done, we will leave you with one more thing. Throughout this book, we will review some add-on hardware to access the GPIO peripherals on the Raspberry Pi. In this project, we will discuss the Pi Crust board for the Raspberry Pi.

The Pi Crust board was designed by Joe Walnes. It is a board that is stackable on the Raspberry Pi and eliminates the need for a breadboard to prototype circuits.

Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi

A Pi Crust board

The Pi Crust is an open source add-on hardware and costs approximately $14 to build one ourselves. The design can be downloaded free of cost from http://picru.st.

So, it is up to you to decide whether you want to simply buy one, build one, or as we are prone to encourage, improve upon it and open source it for others to benefit!

The main advantage behind Pi Crust is that it is aids prototyping. It allows easy access to the I2C interface, SPI interface, UART port, and the GPIO pins. The following figure shows BlinkM—an I2C-driven RGB LED mounted on top of the Pi Crust.

Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi

Pi Crust stacked on top of the Raspberry Pi

Mission accomplished

Now that you have traveled this far with us, how do you feel? Do you need a break, or more coffee? Before you do either, let's review.

In this project, we got started with the LED blinking example using the Raspberry Pi. We discussed the setup of GPIO peripherals and using them in an experiment. You are welcome to continue experiments with the GPIO peripherals with projects such as LED sequencing, three bit counter, and so on.

In the forthcoming projects, we will look into I2C communication, SPI communication, and UART communication (serial port).

Hotshot challenge

Well done; you have taught your Pi to say "Hello World"! However, we are sure you can do more, much more. Have you watched the movie Close Encounters of the Third Kind? Well, if not, you should. However, this is not a challenge in itself. In the movie, the human beings attempt at communication with what they believe is aliens by building a pattern of lights that are set to music. Can you make a pattern of LEDs repeat that or something similar?

Left arrow icon Right arrow icon

Description

This book is targeted towards beginners and intermediate designers of mechatronic systems and embedded system design. Some familiarity with the Raspberry Pi and Python programming is preferred but not required.

Who is this book for?

This book is targeted towards beginners and intermediate designers of mechatronic systems and embedded system design. Some familiarity with the Raspberry Pi and Python programming is preferred but not required.

What you will learn

  • Prototype electronic circuits to solve problems using the Raspberry Pi
  • Learn simple prototyping tools such as a laser cutter to build mechanisms that interface with the Raspberry Pi
  • Interface with standard development platforms such as the Arduino and different operating systems
  • Build simple tools that will help you in your daytoday life
  • Learn the nuts and bolts details of mechatronic system development through examples like a Christmas light controller and a personal health monitor
  • Get to grips with the practical implementation of robotics and home automation
  • Troubleshoot problems that arise during the implementation of your projects

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 26, 2015
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781849696227
Vendor :
Raspberry Pi
Category :
Concepts :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Feb 26, 2015
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781849696227
Vendor :
Raspberry Pi
Category :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 82.97
Raspberry Pi Embedded Projects Hotshot
€36.99
Raspberry Pi Sensors
€24.99
Raspberry Pi for Secret Agents - Second Edition
€20.99
Total 82.97 Stars icon

Table of Contents

14 Chapters
1. Hello World Chevron down icon Chevron up icon
2. A Raspberry WebIDE Example Chevron down icon Chevron up icon
3. The Arduino Raspberry Pi Interface Chevron down icon Chevron up icon
4. Christmas Light Sequencer Chevron down icon Chevron up icon
5. Internet of Things Example – An E-mail Alert Water Fountain Chevron down icon Chevron up icon
6. Raspberry Pi as a Personal Assistant Chevron down icon Chevron up icon
7. Raspberry Pi-based Line Following Robot Chevron down icon Chevron up icon
8. Connect Four Desktop Game using Raspberry Pi Chevron down icon Chevron up icon
9. The Raspberry Pi-enabled Pet/Wildlife Monitor Chevron down icon Chevron up icon
10. Raspberry Pi Personal Health Monitor Chevron down icon Chevron up icon
11. Home Automation using Raspberry Pi Chevron down icon Chevron up icon
12. Using a Raspberry Pi for Science and Education Chevron down icon Chevron up icon
13. Tips and Tricks Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.