Beret

An educational project to program the Rainbow HAT on Android Things built on Blockly

View the Project on GitHub plattysoft/Beret

Beret

Beret is an educational project to program the Rainbow HAT on Android Things using a visual language built on Blockly (which is a library from Google for building beginner-friendly block-based programming languages)

You can write the code directly on the Android Things device, or you can write it on an Android phone or tablet and send it over using Nearby

There are a few similarities between Beret and Micro:bit, both are great tools to introduce coding that interacts with hardware. Beret is intended to be an introduction to Android Things, but you can just use it as it is.

Using Beret

There are 2 main ways to use Beret: Directly on a developer kit or with a companion app

Using Beret directly

When you use Beret direclty you write the programs in the same device that runs them, which has certain appeal. For this you need an Android Things developer ket installed with Beret (see next section for options) and a way to interact with it.

For a Raspberry Pi a common use case is to attach an HDMI Monitor and a mouse (and optionally a keyboard).

For an iMX7D a common use case is to use the touchscreen included with the development kit.

Using Beret Editor

The other option is to have a developer kit withouth any screens and use a tablet with the Beret companion app to write the programs. When you press run the program is sent to the Android Things developer kit using a nearby connection. It takes a bit longer but it is handier.

Note that at the momnent you have no way to select the target developer kit, so if you have more than one it can be disconcerting.

Installing

You need to have an Android Things developer kit. You can use a monitor, keyboard and mouse connected to your dev kit, or you can use the companion app on a tablet to create your programs. You have a few options, I suggest you take the easy way.

The simple way

How to flash an Android Things image on a Raspberry Pi

The easy way

Prerequisites:

Steps:

The slightly harder way (if you like compiling things)

Prerequisites:

Steps

Available Blocks

The list of currently available blocks for the Rainbow HAT is:

Buttons

Button blocks

LEDs

LED blocks

LCD display

LCD display blocks

Sensor

Sensor blocks

Piezo buzzer

Piezo buzzer blocks

RGB LED Strip

RGB LED Strip blocks

Functional blocks (hooks)

Temporary removed due to misbehavior

Code Samples

This is a list of suggested exercises for beginners. Proper project descriptions in the style of Code Club will be provided soon.

Future Work (soon to be moved into the issue tracker)

Known issues

References

If you want to get started on Android Things and the Rainbow HAT, I suggest to take a look at the book Android Things Quick Start Guide