Page 2
Breakout! These breakouts eliminate nearly all the inconvenience of using buttons by converting everything to an easy-to-use I2C connection using the Qwiic Interface. SparkFun Qwiic Button - Red LED BOB-15932 SparkFun Qwiic Button - Green LED BOB-16842 SparkFun Qwiic Button Breakout...
We have three versions of the Qwiic Button available. The Qwiic Button (Red) and Qwiic Button (Green) come with a pre-populated red or green pushbutton with a built in LED to illuminate the button and the Qwiic Button Breakout leaves the button unpopulated so you can choose your own tactile button.
Page 4
● LED Tactile Button - Green ● LED Tactile Button - Blue Realistically, you can solder any pushbutton to the Qwiic Button Breakout so long as it fits the button footprint. We have a couple other options available in our...
Suggested Reading If you aren't familiar with the Qwiic system, we recommend reading here for an overview. Qwiic Connect System We would also recommend taking a look at the following tutorials if you aren't familiar with them. ● Button and Switch Basics: A tutorial on electronics' most overlooked and underappreciated component: the switch! Here we explain the difference between momentary and maintained switches and what all those acronyms (NO, NC, SPDT,...
The LED's anode (positive pin) is connected to an I/O pin on the ATtiny84 so you can turn it on and off as well as control the brightness. If you have the Qwiic Button Breakout, you can choose your own color of button from the selection listed in the Introduction of this guide or any tactile button that fits the footprint on the breakout.
Page 7
Qwiic and I C Interface The easiest way to use the Qwiic Button is with the Qwiic connect system. Simply plug in a Qwiic Cable to start talking to it. Qwiic Connectors C Pins Alternatively, you can solder to the I2C pins broken out on the board.
Page 8
I2C address. The firmware reads the logic of each address pin so, by closing multiple jumpers, you can modify the Qwiic Button with up to sixteen unique addresses! If you do not want to use the address pins, the address can also be configured using the...
Page 10
C Pull-Up Resistors Severing the trace on the I2C jumper will remove the 2.2kΩ pull-up resistors from the I2C bus. If you have many devices on your I2C bus you may want to open these jumpers by severing the trace in between the pads.
With the Qwiic connector system, assembling the hardware is simple. All you need to do is connect your Qwiic Button to Qwiic-enabled microcontroller with a Qwiic cable. Otherwise, you can use the I2C pins if you don't have a Qwiic connector on your microcontroller board.
Page 12
Tactile Button with an integrated LED, remember to pay close attention to the polarity marks on your button and match them to the markings on the top of the Qwiic Button Breakout. If you purchased a tactile button from SparkFun, the anode will be marked with a small "+"...
Page 13
Multicolor Button 4-Pack: Qwiic Button Arduino Library The easiest way to install the library is to search for SparkFun Qwiic Button in the Arduino Library Manager tool. You can also manually install the Qwiic Button Library from the GitHub Repository...
Library Functions Here is a list of the functions of the library with some quick descriptions of what they do. The examples cover most of the functions so we recommend going through them first. Device Status ● - Sets device begin(uint8_t address = DEFAULT_ADDRESS, TwoWire &wirePort = Wire);...
Page 15
Interrupt Status/Configuration ● - Configure the interrupt pin to go LOW while the uint8_t enablePressedInterrupt(); button is pressed (held down). ● - Sets the interrupt to no longer trigger while the uint8_t disablePressedInterrupt(); button is pressed. ● - Configure the interrupt pin to go LOW when the uint8_t enableClickedInterrupt();...
Page 16
Arduino Examples In this section we will go over a few of the examples from our Qwiic Button Arduino Library. Here is a full list of all the examples included in the library: ●...
Page 17
Example 1: Print Button Status The code for Example1_PrintButtonStatus connects the Qwiic Button to the I C bus and prints the status of the button (pressed or not pressed) to the Serial Monitor. Example 3 Pulse When Pressed Example3_PulseWhenPressed connects the Qwiic Button to the I C bus and runs the Button LED through a configured sequence when the button is pressed.
Page 18
Heads up! This example will not change the I2C address if one of the address jumpers is closed. The Qwiic Button will remain at the alternate address set by the address jumpers. Example5_ChangeI2CAddress checks to initialize the Qwiic Button on the I2C bus. If the device ID matches what is expected (0x6F by default), it then will print some helpful information for changing the I2C address and prompt you for an input to change the address.
Page 19
You will want to solder to the INT pin and connect it to an interrupt-capable pin. If you just need to quickly prototype a circuit using the INT pin on the Qwiic Button, you can connect to it using something like these Hooks. The photo below demonstrates how to use the IC Hook for a temporary connection.
You can also download the PDF. The Qwiic Button behaves as a normal I2C device. First write the address of the register you would like to read or write, then follow that I2C command with a Read to read the given...
Page 21
Working with Qwiic on a Jetson Nano through Jupyter Notebooks. We've written a Python package to easily get setup and use the Qwiic Button. There are two methods for installing the Python package for the Qwiic Button. 1. Install the all inclusive SparkFun Qwiic Python package.
PyPi Installation This repository is hosted on PyPi as the sparkfun-qwiic-button package. On systems that support PyPi installation via pip3 (use pip for Python 2) is simple, using the following commands: For all users (note: the user must have sudo privileges): sudo pip3 install sparkfun-qwiic-button For the current user:...
Page 23
# runtine # The name of this device _DEFAULT_NAME = "Qwiic Button" # Some devices have multiple available addresses - this is a list of these addresses. # NOTE: The first address in this list is considered the default I2C address for the # device.
Page 24
Note: This package is different from previous packages as the register variables are declared in the object class. # QwiicRFID CLASS VARIABLES #------------------------------------------------------------------------------ ---------------------- # Device ID for all Qwiic Buttons DEV_ID = 0x5D # Registers ID = 0x00 FIRMWARE_MINOR = 0x01 FIRMWARE_MAJOR = 0x02...
Page 26
Class QwiicButton() QwiicButton(address) This Python package operates as a class object, allowing new instances of that type to be made. An __init__() constructor is used that creates a connection to an I2C device over the I2C bus using the default or specified I2C address. The Constructor A constructor is a special kind of method used to initialize (assign values to) the data members needed by the object when it is created.
Page 27
For all users (note: the user must have sudo privileges): sudo pip3 install --upgrade sparkfun-qwiic-button For the current user: pip3 install --upgrade sparkfun-qwiic-button Python Examples Note: Work on this section is in progress. We will update the content as soon as we can.
Page 28
Arduino Wire Library Reference Page ● Arduino Wire Library (In-Depth) Reference ● Looking for some inspiration for a project using the Qwiic Button? Check out this Geo-Mapping project Brandon J. Williams. Before you go, here are some other tutorials using the Qwiic Connect System you may want to...
Page 29
TFMini - Micro LiDAR Module (Qwiic) Hookup Guide The TFMini is a ToF (Time of Flight) LiDAR sensor capable of measuring the distance to an object as close as 30 cm and as far as 12 meters! The TFMini allows you to easily integrate LiDAR into applications traditionally reserved for smaller sensors such as the SHARP GP-series infrared rangefinders.
Need help?
Do you have a question about the Qwiic Button and is the answer not in the manual?
Questions and answers