Skip to content

mic159/sparkfun_button_2x2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Sparkfun Button Pad 2x2

This is sample code to drive the Sparkfun Button Pad 2x2 from an Arduino.

It lights up the LEDs different colors each time you press it.

Hardware

You will need:

Theory

To drive the LEDs we are going to use PWM/AnalogWrite to drive the common pin on each LED, then cycle through each color one at a time. You need to put the resistors where it will not be supplying current for more than one LED at a time, so we put it on the common pins of each LED.

For reading the buttons, I used the Keypad library. It handles all the debouncing and pin IO for you, which is handy.

Wiring

PCB Label Arduino Pin
SWITCH A0
SWT-GND1 A1
SWT-GND2 A2
SWT-GND3 A3
SWT-GND4 A4
LED-GND1 3
LED-GND2 5
LED-GND3 6
LED-GND4 9
RED 4
GREEN 7
BLUE 8

About

Sample Arduino code to drive the Sparkfun button pad 2x2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages