How to make a simple button for Dummy's??HELP

Status
Not open for further replies.

less2

New member
Good Day,
This is my first post and I'm looking for some much needed help. I want to make a button for a DIY photo booth, the button needs to emulate a space bar strike. But all the coding and soldering talk is Greek to me. I have a Teensy and I'm running windows after that I'm lost. If someone would be so kind and point me in the right direction.
Thanks
 
Teensy really is about DIY electronics, so you're going to have to learn a few things to get this done. If you don't have the time or interest to learn some new tech skills, I'd highly recommend you simply buy one that is already made. It does cost more than only buying the raw materials, but if your time is valuable (and learning electronics skills wouldn't be a good time investment), it's really not terribly expensive considering the time you'll spend. Here's the link:

http://store.2xlnetworks.com/thebutton/

To build it yourself, the first you must learn to walk before you can run. Well, at least blink an LED before you can push a button!

First, you'll need to download the Arduino software and the Teensyduino installer. Unzip Arduino (and make a mental note of when it is on your computer), then run the Teensyduino installer to add the Teensy stuff.

http://www.pjrc.com/teensy/td_download.html

Then you'll run Arduino. Select Teensy from the Tools > Boards menu. The open the LED blink from File > Examples > 01.Basics > Blink. If using a Teensy 2.0, edit the pin number to 11 (read the comments in the code). Every Teensy comes with pre-loaded with a program that blinks the LED. Your goal is to program the LED blink to blink at different speeds. This page has a detailed tutorial.

http://www.pjrc.com/teensy/tutorial.html

If you run into problems, solutions to all the most common issues are on this troubleshooting page:

http://www.pjrc.com/teensy/troubleshoot.html

You can also ask for help here. But generally you'll get much better answers if you post details of what you've already done, specific info about what's going wrong (even screenshots or photos), and what you've already tried and what did or didn't happen.


So, once you have mastered the LED and you can make it blink at your whim, you're ready to do the button. Again, start with an example. Open it using File > Examples > Teensy > USB_Keyboard > Buttons.

This example requires you to set Teensy to act as a Keyboard. Use the Tools > USB Type menu to select "Keyboard + Mouse + Joystick". Then program it with that example.

Before you bother with using an actual button, you can use just a piece of wire or a paperclip. The button just connects its 2 wires together when you press it, so you can "press" a missing button by just touching 2 pins together with a paperclip.

Always touch the paperclip to the GND pin first. If you've built up a static charge, it's safe to "shock" the GND pin. Then touch the other side to a nearby pin (but never touch GND and +5V or VCC together). If Teensy is running the buttons example, you should see things like "B0_press" and "B0_release" being typed into your computer as you touch between GND and pin 0 (which is the one right next to GND, near the USB connector).

One you have that working, the next step is to modify the code to type only a space instead of B0_press. And of course when you have it working exactly the way you want with a paperclip, then you'll need to physically connect a pushbutton, and fabricate an enclosure for the whole thing somehow.
 
Thanks so much, this should get me started. Coding and electronics has been something I've wanted to learn for some time. This button looked liked a great starter project. And buying something that I can do myself is never feasible. Especially if I've never tried it. Thanks again, I'll post my results shortly.
 
Thanks a lot every one got it done with out a hitch, well just some soldering issues but I got it together. Can't wait to start something else.
 
Great, glad you got it working. If you have any photos of the final build in actual use, would love to see them?
 
Hello Paul:

Thank you for nearly the instant e-mail reply today. I went through each step listed above and made major progress. Thank you!

I got an LED to blink, and tried different things for it to type in, and all worked.

Here is the only thing I am caught up on... I want the button to type a space only, and it is typing a space followed by a return (enter) key. Any possible way to get this to only type the space without the return?

Also, how would I get it to act like an arrow key? What would I type in the Keyboard.println("TYPE HERE"); field to get it to make a right or left arrow?

Thanks again for your help.
 
Thank you greatly Paul, that worked perfectly. Did you get a chance to notice my second question about the arrow keys? Please let me know when you get a chance and thanks again!

Did you happen to figure out a code to make the left and right arrows work? Thanks!
 
Status
Not open for further replies.
Back
Top