Arduino Library
The Soldered-Button-LED-Buzzer-Board library handles the I2C communication with
the board's ATtiny404 for you. Include ButtonLedBuzzerBoard-SOLDERED.h, create
one ButtonLedBuzzerBoard_Soldered object, call begin(), and you can read the
buttons, set the LED colours and play tones.
Not installed yet? Follow Quick Start before using the functionality pages.
Functionality
Each page starts with one verified library example and explains every function the example uses to get that result.
Arduino exampleSet the LED coloursLight each RGB LED on its own, or all three in one colour.Arduino exampleRead the buttonsPrint a line to the Serial Monitor each time a button is pressed or released.Arduino examplePlay tones on the buzzerPlay a sequence of tones at frequencies you choose, in Hz.Arduino exampleButtons, LEDs and buzzer togetherEach button lights its own LED while you hold it, and the buzzer plays the tone of the highest-numbered button held.Arduino exampleFull demoButton states on the Serial Monitor, LEDs cycling through colours and a beep on every change.
How the library talks to the board
The library reads and writes three registers on the board. You only need them if you write your own code for another platform.
| Register | Direction | Contents |
|---|---|---|
0x00 | Read | Button states, 1 byte: bit 0 is BTN1, bit 1 is BTN2, bit 2 is BTN3 |
0x01 | Write | LED colours, 9 bytes: red, green and blue for LED 0, then LED 1, then LED 2 |
0x02 | Write | Buzzer frequency in Hz, 2 bytes, high byte first; the examples write 0 to stop the tone |