{"id":17643767,"url":"https://github.com/mic159/sparkfun_button_2x2","last_synced_at":"2026-02-15T16:04:27.017Z","repository":{"id":11574638,"uuid":"14063184","full_name":"mic159/sparkfun_button_2x2","owner":"mic159","description":"Sample Arduino code to drive the Sparkfun button pad 2x2.","archived":false,"fork":false,"pushed_at":"2022-10-28T13:03:29.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T11:07:37.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mic159.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-02T08:11:28.000Z","updated_at":"2023-02-21T07:34:33.000Z","dependencies_parsed_at":"2023-01-11T18:08:29.446Z","dependency_job_id":null,"html_url":"https://github.com/mic159/sparkfun_button_2x2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mic159/sparkfun_button_2x2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic159%2Fsparkfun_button_2x2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic159%2Fsparkfun_button_2x2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic159%2Fsparkfun_button_2x2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic159%2Fsparkfun_button_2x2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mic159","download_url":"https://codeload.github.com/mic159/sparkfun_button_2x2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mic159%2Fsparkfun_button_2x2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29483331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T15:33:17.885Z","status":"ssl_error","status_checked_at":"2026-02-15T15:32:53.698Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T09:24:09.558Z","updated_at":"2026-02-15T16:04:27.001Z","avatar_url":"https://github.com/mic159.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sparkfun Button Pad 2x2\n=======================\n\nThis is sample code to drive the Sparkfun Button Pad 2x2 from an Arduino.\n\nIt lights up the LEDs different colors each time you press it.\n\nHardware\n========\n\nYou will need:\n - Button Pad\n   - Button Pad 2x2 (silicone pad): [Sparkfun](https://www.sparkfun.com/products/7836) || [Little Bird](http://littlebirdelectronics.com/products/button-pad-2x2-led-compatible)\n   - Button Pad 2x2 PDB: [Sparkfun](https://www.sparkfun.com/products/9277) || [Little Bird](http://littlebirdelectronics.com/products/button-pad-2x2-breakout-pcb)\n   - RGB LEDs (Common Cathode): [Sparkfun](https://www.sparkfun.com/products/9853) || [Little Bird](http://littlebirdelectronics.com/products/5mm-triple-output-led-rgb-common-cathode-20-pcs-pack)\n   - Diodes 1N4148: [DX](http://dx.com/p/in4004-1n4148-bat85-schottky-signal-diodes-3-x-20-pcs-152549)\n   - Top bezel: [Sparkfun](https://www.sparkfun.com/products/8746) || [Little Bird](http://littlebirdelectronics.com/products/button-pad-2x2-top-bezel)\n   - Right angle pin headers: [Little Bird](http://littlebirdelectronics.com/products/break-away-headers-right-angle)\n - On the breadboard\n   - 100 Ohm Resistors x4: [DX](http://dx.com/p/diy-1-4w-resistance-metal-film-resistors-2500-pcs-152924)\n   - Arduino (I used a Nano): [DX](http://dx.com/p/arduino-nano-v3-0-81877)\n - Wires: [DX](http://dx.com/p/arduino-dupont-4-pin-male-to-female-extension-wire-cable-40cm-10-piece-pack-140523)\n   - What you get for this depends on your use case, but I used these to plug into my breadboard.\n\nTheory\n======\n\nTo 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.\nYou 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.\n\n\nFor reading the buttons, I used the [Keypad](https://github.com/Nullkraft/Keypad.git) library. It handles all the debouncing and pin IO for you, which is handy.\n\nWiring\n======\n\n| PCB Label     | Arduino Pin |\n| ------------- | ----------- |\n| SWITCH        | A0          |\n| SWT-GND1      | A1          |\n| SWT-GND2      | A2          |\n| SWT-GND3      | A3          |\n| SWT-GND4      | A4          |\n| LED-GND1      |  3          |\n| LED-GND2      |  5          |\n| LED-GND3      |  6          |\n| LED-GND4      |  9          |\n| RED           |  4          |\n| GREEN         |  7          |\n| BLUE          |  8          |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmic159%2Fsparkfun_button_2x2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmic159%2Fsparkfun_button_2x2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmic159%2Fsparkfun_button_2x2/lists"}