Project: Using Flotilla Colour module to detect coloured balls


#1

I’ve been working with the colour module, and now have it reliably detecting 4 different Lego coloured balls. I’ve devised a small cradle to hold the balls while they are being scanned, and use four different methods of displaying the result.

  1. the colour is printed on the Raspberry Pi monitor
  2. the colour name is scrolled as a message across the matrix screen
  3. the rainbow leds are set as near as possible to the colour
  4. a sound .wav file is played which announces the colour

The program is written in the Sniff language which supports flotilla

A video of the project in action is on youtube here

The Sniff rainbow module uses Hue and Brightness as its two inputs to the hardware, so the program calculates the HLS values from the scanned RGB values and determines the best match to decide upon the colour.
It seems quite reliable. In order to get consistent results the cradle holds the balls in a fixed position in relation to the sensor.