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

LEDs

If you are familiar with how Arduino code is structured, you may be expecting to have a setup and a loop methods. Android Things can work like that too. We will start with our methods named using that convention to provide a common ground if you have experience with Arduino. However, Android Things allows us to write code in a much more structured way. In this section we will start with something close to the Arduino way, explain its drawbacks, and show better alternatives, showing the different ways to blink an LED.

Blinking an LED is the IoT equivalent of Hello World.

Let's get into blinking an LED the Arduino way.

The Arduino way

The simplest way is to have a setup where we initialize the LED, followed by a loop...

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 $15.99/month. Cancel anytime}