The main thing the 'grains of sand' code does is act like...grains of sand! If you tilt the TrellisM4 in any direction, the motion is detected by the accelerometer and the sand grains 'flow' in the direction of tilt.

A sharp 'tap' anywhere on the NeoTrellis will switch the color mode - there are three modes built in:

  • Rapidly cycles through random colors (default)
  • A gradient based on the pixel index
  • Solid color that changes with a button press

In the solid color mode, pushing any button on the NeoTrellis will rapidly change the color randomly. You can hold down for a random color effect, or quickly press to change to a new random color.

Don't forget the sound!

If you plug headphones into the jack on the NeoTrellis M4, or alternatively plug it into a set of powered speakers, the 'water drop' sound will play each time a sand grain moves.

This guide was first published on Feb 13, 2019. It was last updated on Feb 13, 2019.

This page (Play!) was last updated on Feb 10, 2019.

Text editor powered by tinymce.