0

November 6, 2015 AT 10:00 am

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

NewImage

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!


Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

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

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!


Maker Business — Alibaba to invest $15b in tech, set up research labs around the world

Wearables — Hand beading mimicry

Electronics — Trigger happy oscilloscope?

Biohacking — Biohacking: Visioneer – AI Glasses to Assist the Visually Impaired

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.