Micromelon Robotics
Platform
Resources
NewsAbout UsDownload
Support
Build Your Kit

Stay in the loop

New activities, teaching guides, and product updates delivered to your inbox.

Micromelon Robotics

Australian-made educational robotics for the next generation of innovators.

contact@micromelon.com.au

Company

  • About Us
  • Privacy Policy
  • Terms and Conditions

Products

  • Micromelon Rover
  • Code Editor
  • Robot Simulator
  • Junior
  • Python Library

Support

  • Resources
  • News
  • Rover Repairs
  • Contact
  • Build Your Kit

© 2026 Micromelon Robotics Pty Ltd. All rights reserved.

ABN 56 623 302 296

← Back to Resources
ActivitiesIntermediate

Activity: Colourful Sounds

Coding Skills

IterationMaths

Rover Concepts

ColourBuzzerLEDs
Activity: Colourful Sounds

Create a program that translates data from the colour sensors into LED output and sound. When you move your Rover over new colours, the LEDs match the surface colour and the buzzer plays a tone unique to that colour.

Rover playing colour-driven sounds

Rover playing colour-driven sounds

Setup

This exercise requires access to many different coloured surfaces or cards. Lay them out on the floor in different orders and have the Rover drive across them to play different tunes. To make the music sound good, you’ll have to do some more complex calculations from the hue value to frequency, try looking up the frequencies of musical notes.

Our Approach

Stage 1: Match LEDs to the Colour

We want to set all the LEDs to the colour the sensor is detecting. The Set LED blocks use an RGB value, but the colour sensor blocks don’t return values in RGB. We need a way to translate the sensor value to an RGB value. One value we can read from the colour sensor block is hue, so use a Hue Colour block from the Colour category and place that inside the Set All LEDs block.

Stage 2: Play a Sound from the Colour

The hue value is a single number. The buzzer can play a sound at a specific frequency (in Hz), which is just a number of vibrations per second. Place the hue value directly inside a Play Sound at Hz block, and multiply it with a math block to make the sound more pronounced. Try adjusting the calculation to produce better music.

Stage 3: Loop Forever

Wrap the behaviour in a While True loop so it repeats indefinitely. Once it’s running, you can pick up and move the Rover over new colours around you and it will keep playing sound.

Example code, colour to LEDs and buzzer in a forever loop

Example code, colour to LEDs and buzzer in a forever loop

Try experimenting with different colour arrangements and multiplier values to create your own tunes.

Continue Learning

Activity: Making Music IRelated resourceActivity: Making Music IUse the Rover’s speaker to play songs, read sheet music and code the Rover to play each note.

Activity: Rover ThereminRelated resourceActivity: Rover ThereminConvert the Rover into a Theremin, code it to play music using the IR sensors as the volume and pitch antennae.

← Return to Resources