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 ...

Get Raspberry Pi Android Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.