A lesson by Paul Blundell
This lesson is going to show you how to interact with the Android Things Peripheral IO APIs to understand and communicate with a UART peripheral. In this case a ZX Gesture and Motion Sensor. Using this peripheral to code an IoT android app.
We will learn about the Universal Asynchronous Receiver/Transmitter protocol and how to read and use the technical documentation to help us code a UART peripheral. We will discuss the UART API’s, how to deal with IOExceptions in your app, how to manage hardware resources and how Android Things works with the Android lifecycle. Coding an android application to communicate with the the ZX Gesture Sensor to detect swipe events. Swiping left or right to toggle lighting up the LEDs in different colours.
When complete, you will have learnt the basics of UART peripheral communication and also written an Android Things application that will be able to communicate using the ZX Gesture reading it’s packets of bytes, to detecting a hand swiping left or right.
For this lesson you will require:
If you need to buy the Raspberry Pi to start with Android Things I would recommend this kit. It contains:
- Raspberry Pi 3
- Rainbow HAT
- Pibow Coupé for Android Things
- 2.5A official Raspberry Pi worldwide power supply
- 8GB microSD card
Sign up for access to the source code.
Lessons in this course
- Introduction to Android Things
- Flashing the Android Things Firmware to a Device
- Connecting Android Things to Wifi with ADB over Wifi
- Android Things – Understanding Pinout Diagrams
- Android Things – The Rainbow Hat Overview
- Android Things – Your First Android Things App
- Android Things – Peripheral IO, learning GPIO input
- Android Things – Peripheral IO, learning GPIO output
- Android Things – Peripheral IO, learning PWM
- Android Things – Working with a Temperature Sensor via I²C Input
- Android Things – Understanding Datasheets
- Android Things – Peripheral IO, learning SPI & Activating a Rainbow of LEDs
- Android Things – Working with an Alphanumeric Character Display via I²C Output
- Android Things – Peripheral IO, learning UART with the ZX Gesture Sensor