Tally Lights

The goal of this example is to demonstrate how to use LEDs to indicate the most recently pressed button using ON/OFF Group building blocks. This assumes that the reader is familiar with the basics of creating Building Blocks as shown in the Detailed Tutorial, and how to setup a button to generate a simple keystroke as shown in the Keyboard Keystroke example.

In this example, three buttons on the Razer Orbweaver will generate a key command, and use an LED to indicate which button was last pressed:

Orbweaver ButtonKey CommandLED
Button 03Command-1Yellow
Button 04Command-2Green
Button 05Command-3Blue

For each button, one set of four building blocks are needed: a Button building block that responds to the button on the Orbweaver, a Single Key building block to generate that button's key combination, an ON/OFF Group building block to track which button was most recently pressed, and an LED building block to control an LED on the Orbweaver:



The three ON/OFF Group building blocks are all members of the "Tally Lights" group. When one member of the group turns ON, the others turn OFF.

The three LED building blocks are each configured to turn on their respective LED when the building block turns ON, and to turn off their LED when the building block turns OFF.