Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Things Quick Start Guide

You're reading from  Android Things Quick Start Guide

Product type Book
Published in Aug 2018
Publisher Packt
ISBN-13 9781789341799
Pages 192 pages
Edition 1st Edition
Languages
Author (1):
Raul Portales Raul Portales
Profile icon Raul Portales

Using GPIO for output

Digital output is used to control devices. LEDs are just an easy and visual way to check that things work, and we will start by revisiting them to set the concepts and then look at relays, which are one of the most versatile components we can use.

LEDs

In this section we will see how to handle LEDs directly, learn a bit more about PeripheralManager (the class you use to access peripherals), and understand how GPIO works for output.

So, let's begin by replacing the utility method from the Rainbow HAT meta driver with some code that accesses the pins directly.

Given that we are already using a Gpio object to handle the LEDs, the only part that we need to change is how to open it. We already looked...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}