Book Image

Raspberry Pi Android Projects

By : Gökhan Kurt
Book Image

Raspberry Pi Android Projects

By: Gökhan Kurt

Overview of this book

Table of Contents (13 chapters)
Raspberry Pi Android Projects
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sending more commands from your Android phone to the Pi


In the previous section, we have sent the reboot command from Android to the Pi. In this section, we will send two new commands. One to light up a LED that we will connect to the Pi, and another to play sound on the Pi. These commands will be reused in the forthcoming sections.

Lighting the LEDs

We'll begin by connecting a LED light to the GPIO ports of the Pi. The LEDs usually come with a short and long leg. Connect a resistor to the short leg of the LED, and connect a female/female jumper to the other side of the resistor. This jumper should then be connected to one of the ground pins of the Pi. Take a look at the schema in Chapter 2, Server Management with Pi, to identify the pins. Note that we already used one of the ground pins when we connected our temperature-humidity sensor to the Pi. However, there are plenty of ground pins available. The long leg of the LED should be connected to one of the GPIO pins. We will choose number 17...