Skip to content

Instantly share code, notes, and snippets.

@todbot
Last active April 24, 2018 08:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todbot/be18f570e4140d6a29e429dbd6826f5f to your computer and use it in GitHub Desktop.
Save todbot/be18f570e4140d6a29e429dbd6826f5f to your computer and use it in GitHub Desktop.
Using blink1-tool to make a blink(1) customized flashing pattern

Create the pattern with a custom color:

This pattern has only two lines: a color and off.
The result if played on repeat is a flashing.

echo "making pattern"
blink1-tool -m 500 --rgb ff00ff --setpattline 0
blink1-tool -m 500 --rgb 000000 --setpattline 1

Try it out, make sure to only play those two lines

The --play commands takes three args: play/stop (1/0), start position, end position. So this says: "start playing from 0 up to 2 (but not including)"

echo "playing my pattern, infinitely"
blink1-tool --play 1,0,2

Then, set the custom flashing color

echo "changing pattern color (while previous is playing)"
blink1-tool -m 500 --rgb 00ffff --setpattline 0

Now set to constant color, also stops pattern

echo "setting to constant green"
blink1-tool --rgb 00FFFF

Start back flashing again, with a new color

echo "new color flashing"
blink1-tool -m 500 --rgb FFFF00 --setpattline 0
blink1-tool --play 1,0,2

Turn everything off

blink1-tool --off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment