Sparkfun Electronics Qwiic Button Technical document

SparkFun Qwiic Button
Hookup Guide
BOB-15932 / BOB-16842 / BOB-15931

Qwiic Micro OLED Hookup Guide
Introduction
Buttons are a great way to add a tactile input to your project but dealing with pull-up
resistors, debouncing, polling, and using GPIO pins for each button can be a hassle. Enter the
Qwiic Button (Red or Green) and the Qwiic Button 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
BOB-15931

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.
Using the Qwiic Button is as simple as sending the command button.isPressed() to check the
status of the button. In addition to handling status checks and debouncing, the Qwiic Button
has a configurable interrupt pin which can be adjusted to activate upon a button press or
click. This allows you to trigger specific behavior or functions in your code when the button
is used and frees up processing time that would normally be used to constantly poll a
button's state.
The Qwiic Button also includes a First-in First-Out (FIFO Queue) which keeps track of when
the button was pressed so if you are hosting a game show you can easily keep track of which
contestant pressed their button first without needing to constantly poll the buttons!
Required Materials
The Qwiic Button requires a Qwiic-enabled microcontroller:
●SparkFun Thing Plus - ESP32 WROOM
●SparkFun RedBoard Qwiic
●SparkFun RedBoard Artemis
●SparkFun Qwiic Micro - SAMD21 Development Board
You will also need a Qwiic cable to connect the shield to your OLED, choose a length that suits
your needs.
●Qwiic Cable - 100mm
●Qwiic Cable - 500mm
●Qwiic Cable - 50mm
●Qwiic Cable - 200mm

Or, if you want to use a microcontroller without a Qwiic connector, you can add one using
one of our Qwiic Shields, the Qwiic Adapter board, or adapter cables:
●Qwiic Cable - Breadboard Jumper (4-pin)
●Qwiic Cable - Breadboard Jumper (4-pin)
●SparkFun Qwiic Shield for Arduino
●Qwiic Cable - Female Jumper (4-pin)
Finally, if you are using the Qwiic Button Breakout you'll need to solder a button to the board:
●Momentary Pushbutton Switch - 12mm Square
●LED Tactile Button- White
●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 Button Category that will
work perfectly with the Qwiic Button Breakout.
Heads Up! If you choose an LED Tactile Button, pay close attention to the polarity
marks on your button and Qwiic Button Breakout to place it correctly. If the button
is inserted with reverse-polarity, the LED will not work. If you are not positive on the
polarity of your LED Button, you can use a multimeter to check.
Note: If you want to use the Qwiic Button Breakout then you will need to solder a
tactile button to the board. You may already have a few of these items, so feel free
to modify your cart based on your needs.
●Digital Multimeter - Basic
●SparkFun Beginner Tool Kit
●Solder Lead Free - 15-gram Tube
●Soldering Iron - 30W (US, 110V)

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,
SPST, ...) stand for.
●Introduction to I2C: One of the main embedded communications protocols in use
today.
●Qwiic Shield for Arduino & Photon Hookup Guide Get started with our Qwiic
ecosystem with the Qwiic shield for Arduino or Photon.
●Processor Interrupts with Arduino:What is an interrupt? In a nutshell, there is a
method by which a processor can execute its normal program while continuously
monitoring for some kind of event, or interrupt. There are two types of interrupts:
hardware and software interrupts. For the purposes of this tutorial, we will focus on
hardware interrupts.

Hardware Overview
Tactile Button
This is a standard pushbutton with a built in red or green LED depending in which version
you have. 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.
Red tactile button Button Footprint
Heads Up! If you are using a Tactile Button with an integrated LED, pay close attention to the
polarity marks on the button and match them with the Diode Markings on the Qwiic Button Breakout.
You can use a multimeter to check polarity if you are not sure.

Qwiic and I2C 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 I2C Pins
Alternatively, you can solder to the I2C pins broken out on the board.
ATtiny84
The ATtiny84 has pre-installed firmware to handle
the various functions of the Qwiic Button. It acts as
an intermediary device to send and receive I2C
data for things like button presses, clicks, the FIFO
queue and it allows you to set a custom I2C address
for the Qwiic Button. If you would like, you can
modify the firmware on the Qwiic Button using the
2x3 pins on the back of the board. The firmware
can be found in the Hardware GitHub Repository
and if you need help programming the ATTiny84,
check out this tutorial.
Jumpers
Note: Never worked with solder jumpers before? Or maybe just need some tips or a quick
refresher? Check out our How to Work with Jumpers and PCB Traces tutorial.

I2C Address Jumpers
There are four solder jumpers on the board (labeled A0, A1, A2 and A3) you can close to set
the 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 ChangeI2CAddress
Example from our Arduino Library.
●All Open: Factory or User Set I2C Address: 0x6F (Factory Set) or 0x## (User Set)
●Alternate Address Jumpers: Closing an address jumper sets the pin LOW. On boot-up, the
firmware checks the state of these four pins and adjusts the I2C address following this logic:
0b0110,A3,A2,A1,A0 For example, with both A0 and A1 jumpers closed, (A0 = 0, A1 = 0, A2
= 1, A3 = 1) the I2C address of the Qwiic Button is set to 0x6C (0b01101100). Check out the
table below for a full list of all the I2C addresses and the jumper logic used to set the
address.
Full I2C Address Table
A0
Logic
A1
Logic
A2
Logic
A3
Logic
Address
(HEX)
Jumper
States
1
1
1
1
0x6F
All Open
0
1
1
1
0x6E
A0 Closed
1
0
1
1
0x6D
A1 Closed
1
1
0
1
0x6B
A2 Closed
1
1
1
0
0x67
A3 Closed
0
0
1
1
0x6C
A0 & A1
Closed
0
1
0
1
0x6A
A0 & A2
Closed
0
1
1
0
0x66
A0 & A3
Closed
0
0
0
1
0x68
A0, A1 &
A2 Closed

0
0
1
0
0x64
A0, A1 &
A3 Closed
0
1
0
0
0x62
A0, A2 &
A3 Closed
1
0
0
1
0x69
A1 & A2
Closed
1
0
1
0
0x65
A1 & A3
Closed
1
0
0
0
0x61
A1, A2 &
A3 Closed
1
1
0
0
0x63
A2 & A3
Closed
0
0
0
0
0x60
All Closed

I2C 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.
Interrupt Pin
The Interrupt Pin can be used to trigger
events on your microcontroller. It is
active LOW and can be configured to
activate on either a button press (held
down) and click (press-and-release). By
default, the Interrupt Pin is pulled to
3.3V via a 10K resistor through this
jumper. Just like the I2C pull-up
resistors, you can open it by severing the
trace in between the pads. This may
come in handy for low-power projects
that do not require the Interrupt Pin.
This manual suits for next models
3
Table of contents
Other Sparkfun Electronics Microcontroller manuals
Popular Microcontroller manuals by other brands

AMS
AMS AS7261 Demo Kit user guide

Novatek
Novatek NT6861 manual

Espressif Systems
Espressif Systems ESP8266 SDK AT Instruction Set

Nuvoton
Nuvoton ISD61S00 ChipCorder Design guide

STMicrolectronics
STMicrolectronics ST7 Assembler Linker user manual

Texas Instruments
Texas Instruments Chipcon CC2420DK user manual

Texas Instruments
Texas Instruments TMS320F2837 D Series Workshop Guide and Lab Manual

CYPRES
CYPRES CY14NVSRAMKIT-001 user guide

Texas Instruments
Texas Instruments INA-DUAL-2AMP-EVM user guide

Espressif Systems
Espressif Systems ESP8266EX Programming guide

Abov
Abov AC33M8128L user manual

Laird
Laird BL654PA user guide







