blink(1) is a neat small USB device with two RGB LED inside. See also their home page.
The scratch code is straightforward. With variable ‘led_1’ the LED#1 is set, and ‘led_2’ sets LED#2. The device supports also a setAll-Command, a variable ‘led_all’ or ‘led_0’ is used for this purpose.
scratchClient is designed to work with raspberry pi, but as pyusb is available on linux in general, this should be generally available on these platforms.
Start scratchClient with
cd ~/scratchClient python src/scratchClient.py -c config_blink
This is the sample scratch Code from the animation. The two led are controlled by a small delay.
Basically, there is the possibility to use more than one blink(1) device. These are identified by their serial number, which can be used to control them separately. Drop me a note if you need this feature.
The usb-control software needs some additional installation, see the the installation remarks in barcode scanner for details.