From the Forums: Raspberry Pi – Multiple buttons on one digital pin #piday #Raspberrypi @Raspberry_Pi

Thanks to Adafruit forums user jackv for sharing this great Instructables tutorial with us!

If you ever find yourself running out of GPIO pins on a RaspberryPi you can put multiple pushbutton switches on a single pin using this method. It sets a variable by timing the charging of a capacitor through a series of resistors with the switches between them.

You will need a RaspberryPi, a breadboard, and a way to run wires from the RaspberryPi to the breadboard. You can use male/female jumper wires but one of the Pi Cobblers listed on this page from Adafruit will make it a lot easier: http://www.adafruit.com/search?q=cobbler

You will also need:

* This is a very handy assortment of resistors https://www.sparkfun.com/products/10969

This project uses the wiringPi libraries, written by Gordon Henderson, for programming the GPIO in C in a style similar to the Arduino IDE.

wiringPi must be installed.

Instructions for download, install and use are located at http://wiringpi.com

wiringPi uses it’s own pin numbering scheme. All pin numbers mentioned in the program or in the text are wiringPi numbers unless otherwise specified.

After installing wiringPi you can obtain a list showing the pin numbering for your specific model of RaspberryPi by opening a command terminal and typing:

gpio readall

Read more.


Featured Adafruit Products!

NewImage

Adafruit Assembled Pi T-Cobbler Breakout for Raspberry Pi: Now that you’ve finally got your hands on a Raspberry Pi® , you’re probably itching to make some fun embedded computer projects with it. What you need is an assembled add on prototyping Pi T-Cobbler from Adafruit, which can break out all those tasty power, GPIO, I2C and SPI pins from the 26 pin header onto a solderless breadboard. This mini kit will make “cobbling together” prototypes with the Pi super easy. Designed for Raspberry Pi Model B Revision 1 or Revision 2. Designed for use with Raspberry Pi Model B AND Model A, both revisions. This will not work with the Raspberry Pi 2 or Model A+ or B+ If you have one of those, check out our 40-pin version of this item. Read more.


NewImage

0.1uF ceramic capacitors – 10 pack: As any engineer will tell you, 0.1uF ceramic capacitors are the magic fairy dust of electronics – sprinkle them over your circuit schematics for good luck! But seriously, a 0.1uF capacitor right next to the VCC pin of your chips will improve stability by filtering out power supply spikes and noise that can cause flaky behavior. We love these little guys, they have 0.1″ spacing so fit into any perf or breadboard, compact and good quality. We use these exclusively in all our kits, and are always handy for any project or prototype! So useful, we offer them in packs of 10. Read more.


2358Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!


Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !


No Comments

No comments yet.

Sorry, the comment form is closed at this time.