Skip to content

Using blink(1) as a programmable nightlight

Tod E. Kurt edited this page Jul 23, 2013 · 9 revisions

You can easily make blink(1) into a nightlight by plugging it into a standard USB charger or other source of 5VDC that isn't connected to a computer. blink(1) will detect it's not talking over USB and will instead play the light sequence programmed into it.

blink(1) as a nightlight

The default light sequence in blink(1) is white -> red -> green -> blue -> ... and you can change that.

There are 12 slots in the light sequencer, numbered 0 to 11. Each slot has an RGB color and a duration in milliseconds. blink(1) plays all 12 slots in order, and then loops forever.

Currently to do that you need to use the blink1-tool command-line program with the "savergb", "readrgb" and "play".

To set the color sequence to flash purple,white,purple,white, then wait 5 seconds and repeat, you could co:

% ./blink1-tool -m 1000 --savergb 0xff,0x00,0xff,0
% ./blink1-tool -m 1000 --savergb 0xff,0xff,0xff,1
% ./blink1-tool -m 1000 --savergb 0xff,0x00,0xff,2
% ./blink1-tool -m 1000 --savergb 0xff,0xff,0xff,3
% ./blink1-tool -m 1000 --savergb 0x00,0x00,0x00,4
% ./blink1-tool -m 5000 --savergb 0x00,0x00,0x00,5
% ./blink1-tool -m    0 --savergb 0x00,0x00,0x00,6
% ./blink1-tool -m    0 --savergb 0x00,0x00,0x00,7
% ./blink1-tool -m    0 --savergb 0x00,0x00,0x00,8
% ./blink1-tool -m    0 --savergb 0x00,0x00,0x00,9
% ./blink1-tool -m    0 --savergb 0x00,0x00,0x00,10
% ./blink1-tool -m    0 --savergb 0x00,0x00,0x00,11


NOTE: depending on which version of blink1-tool you have the "savergb" command might be named "savepattline". (e.g. use "./blink1-tool -m 3000 --savepattline 0x00,0x00,0x00,4")
Clone this wiki locally