Pimoroni Flotilla first play with Python.

The Mega Treasure Chest Flotilla set from Pimoroni, was kickstarter project that got a lot of people interested. A nice package - a hub for a collection of devices such as light sensors, barometer, temperature, switches, motors and many more; all linked to a Raspberry Pi. The kit is shown in the image to the left.

A Python API exist for this system. Instructions on how to set up the Flotilla to work with Python can be found at http://flotil.la/start/ .

I wanted to play with switching the Rainbow (A set of RGB LEDs) outputs to Red, Blue and Green by pressing either 2,3, or 4 on the Touch Sensor as in the images.

Using the mini-kit example from https://github.com/pimoroni/flotilla-python/blob/master/examples/mini-kit.py as the basis, produced a simple system that uses the Touch module and its buttons 2,3 and 4 to change the Rainbow; the code is shown below and ran on a Raspberry Pi 3 using Python 3.

import colorsys
import flotilla
import time

client= flotilla.Client(

def module_changed(channel,module):
    if module.is_a(flotilla.Touch):
        if module.one:

while not client.ready:

lights_on= True

    while True:
        if touch.one:
            lights_on = not lights_on
        if touch.two:
        if touch.three:
        if touch.four:


except KeyboardInterrupt:

The video below shows the system in action.

I look forward to playing with it a bit more and I would love to hear what others are doing with the Flotilla.

An other example of Python and Flotilla in action can be seen at 


Related links

All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.

Popular posts from this blog

Micro:bit, Servo control with Micropython or blocks

mbots - graphical programming and Arduino

4Tronix Bit:Bot Neuron Controlled Edge follower