How do I attach a button to a blinkM that cycles scripts?

  • Question
  • Updated 4 years ago
how can I attach a button to a blinkM that cycles through the pre-defined light scripts?
Photo of Jason Liljengren

Jason Liljengren

  • 2 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 2
Photo of todbot

todbot, Official Rep

  • 611 Posts
  • 155 Reply Likes
Official Response
Perhaps the easiest way to try out the different built-in light scripts is to load up the "BlinkMTester" Arduino sketch available in the BlinkM_Examples.zip bundle and type the "p" command from the Arduino Serial Monitor to play the different scripts.

For example, "p0" will play the reprogrammable light script (default as white->red->green->blue->off, repeat), and "p7" will play a slowly fading magenta flash. You can adjust the speed of the fading by typing the "f" command (e.g. "f100" will make the fading very fast, and "f5" will make it slow). And you can adjust the speed at which the script is played by type the "t" to set the timeadjust value (e..g. "t-10" will cause things to play faster, "t20" to make them play slower) And if you want to stop scripts playing, type "o" to send the Stop command.

At the moment, only BlinkM MaxMs, not regular BlinkMs, can take a button input directly. (There will eventually be an update to regular BlinkMs to allow dual use of BlinkM's I2C as button inputs. If you have access to an AVR-ISP programmer, don't mind doing some breadboarding, and want to try out some beta firmware, contact us at blinkm at thingm.com)