posts tagged with the keyword ‘teensy’

2012.02.26


Buttons

Today’s Maker Business involved some early morning soldering. (What else would I do at 7am?) Next up is programming, and then I need to drill out all the enclosures. (I’m hoping to do that later in the day.)

Oh, I also built a spray booth this weekend since I’ll be doing a bunch of spray painting. (We also use spray glue in the basement, and this should make that a little less messy.)

2011.07.01

Make

Those guys over at Make (who seem to be my new BFF) mentioned another button I made, which was inspired by Matt’s AWESOME Button post on Make, which in turn inspired Patrick from Milwaukee Makerspace to build a footswitch-style button, which got mentioned on Hackaday, which is where I saw the link to Flip’s 1-Key-Keyboard Project.

It’s getting a little circular in here…

So on the Zen Button post, Flip commented on his 1-Key-Keyboard Project, and noted that it had the same “dead-simple functionality” but was a much lower cost.

Make

The “dead-simple” part was also in the post’s description of my button, but I think that “dead-simple” had more to do with the parts and the build than the function, and here’s why I think that matters.

If you go back to the original AWESOME Button post, you’ll see a few people (including me!) wondered if you could use an Arduino instead of a Teensy. Why? Because the Arduino is cheap, and easy, and lots of people already have one.

But the Teensy is also cheap, and fairly easy, maybe just a wee bit more difficult, but still fairly easy, and you just plug the dang thing in via a USB cable and hey, what could be easier!?

But with ease of use comes a price. If you look at Flip’s 1-Key-Keyboard Project, it’s probably what he considered “dead simple” but to me, I see a list of parts including either a ATTiny45-20PU, or ATTiny85-20PU, or ATTiny85, or ATTiny45… and then there’s a few resistors, diodes, capacitors, some prototype-board, and a programmer that works with the Atmel AVRs.

Flip has done a great job writing up the project. I mean, I assume he has, but it’s way over my head. All the comments lead me to believe it’s pretty awesome. If you’re comfortable with everything he talks about, and it all makes sense, then that’s awesome too. Either way, I’m definitely glad Flip shared his project.

For those of us not ready to get that deep into AVR development, things like the Teensy or the Atmega 32u4 are simple enough to use that even beginners can get pretty far. Just in blog post comments and some emails I was able to help a few folks get their Teensys up and running.

Remember, everyone starts out as a beginner… but that’s not to suggest that you eventually need to get to the level where you’ll be using an AVR programmer with bare chips if using an Arduino or some other board does what you want with less hassle. Easy really is one of the main reasons the Arduino platform became so popular.

So if you ever see your project on Hackaday, try not to be discouraged by the commenters who are quick to point out how they would have done it better, faster, cheaper, and with 10 times the capabilities of what yours does, because while they were busy leaving discouraging comments, you were busy making something. :)

Cheers!

NOTE: Need a button? Now you can buy one! Visit our store or Etsy.

2011.06.27

(Another) Button

Button Parts

I totally failed…. I said I was going to try to go a week without making anything, and then I ended up finishing this button I was building.

And yes… it’s another button.

Oh well, I tried!

At least I didn’t paint this one. Really, that’s the most time consuming part of building one of these. (This one is going to someone else, so they may be painting it.)

NOTE: Need a button? Now you can buy one! Visit our store or Etsy.

2011.06.21

Atmega32u4 Breakout Board+

I’ve talked about Adafruit’s Atmega32u4 Breakout Board+ before, first in my post Teensy vs. Atmega32u4 Breakout Board+ and then in the post The Future of Open Source (Part II), so I figured I should actually get a Atmega32u4 Breakout Board+. (Also, I’m just going to call it the Atmega32u4 from now on.)

Now as far as AVR development, I’m a guy who doesn’t like to stray too far from the Arduino world, partly because I find it fun and comfortable, and it does most of what I’ve needed so far. That said, I did end up dabbling with the Teensy for The Button.

Don’t get me wrong, the Teensy is awesome for what it does, and what it is, but occasionally my open source bias takes hold and it bothers me (just a little bit) that the Teensy is not open source. Of course, Adafruit’s Atmega32u4 is open source, which gives it a few more points in it’s favor. Price-wise, the Tensy is $16.00 and the Atmega32u4 is $20.00. Consider it the “open source tax” if you will. (Or buy 100 of them and they’re only $16.00 each then!) (Update: Actually, the Teensy with pins is $19.00 and the Atmega32u4 Breakout Board+ with pins is $20.00, which is even closer in price. You can buy the Teensy without pins at $16.00 but you can’t buy the Atmega32u4 Breakout Board+ without pins.)

So with an Atmega32u4 in hand, and from the perspective of someone who used a Teensy successfully, here’s my review.

Atmega32u4 Breakout Board+ (Close-Up)

You’ll want to start with the Atmega32u4 product page. Without that, I’d still be watching a pulsating LED and swearing.

Read the section titled “Why not use a Teensy” and decide if you really want to use the Atmega32u4 instead. Done? Good. If you still want to use the Atmega32u4, continue reading!

The next section I’d call your attention to is the Using Teensyduino section. As I said, I’m an Arduino guy, so I wanted to give Teensyduino a try. Teensyduino is a software add-on for the Arduino IDE. It adds the ability to build and run sketches on the Teensy. If you don’t want to install avrdude or deal with command line stuff, this is another option. I’m not against using avrdude, but I wanted to try to parallel my Teensy experience, so Teensyduino was part of the toolchain.

I had already installed Teensyduino for use with the Teensy, so the section on that topic was where I jumped in. I walked through the changes, from editing boards.txt to restarting the Arduino IDE. It didn’t work.

But wait! There’s a line that says “Download the Arduino IDE from arduino.cc – as of this tutorial, IDE v21 works best – its not the latest one so scroll down to find it.” And yes, I’m running IDE v22. I’m not sure if that’s what broke things, but rather than download version v21 and try the edits again, I just grabbed the “ready to go” dmg that Adafruit supplied. Since I already had the Arduino IDE in my applications folder, I just renamed it to “ArduinoAtmega32u4″ and ran it. It worked!

So the software installation/configuration part was a bit more difficult for the Atmega32u4 than for the Teensy, at first, but not much of an issue in the end.

Atmega32u4

So here’s a simple blink sketch, slightly modified from one that worked with the Teensy. The one issue with the Atmega32u4 is that you need to press the reset button on the board before you upload a sketch. Each time. Adafruit mentions this, so it’s not a surprise, but you just need to remember to do it. If you use a Teensy or an Arduino all the time, you might forget.

Atmega32u4

So the next test was to make the Atmega32u4 emulate a USB keyboard, just like the Teensy can do. You’ll need to change the menu options, but besides that, it worked well. At this point, with everything working, the differences between the Teensy and the Atmega32u4 seem pretty minimal. Granted, I’m not doing anything complex here, but it’s good to know that I could easily swap out the Teensy for the Atmega32u4 in some situations.

Here’s the code I used, which prints a space, similar to what the Teensy does for The Photo Booth:


void setup() {
  Serial.begin(9600);
  delay(4000);
}

void loop() {
  // Your computer will receive these characters from a USB keyboard.
  Keyboard.print(" "); 

  // typing too rapidly can overwhelm a PC
  delay(2000);
}

So now that I’ve got an Atmega32u4, and know what it can do, the only thing left is to let the hacking begin! :)

2011.05.09

The Button

NOTE: Need a button? Now you can buy one! Visit our store or Etsy.

I was in need of a button, but not just any button. A USB-enabled button that could emulate a single key being pressed on a keyboard. This is that button…

It consists of the following materials:

The Button

I used a Teensy as it’s a very simple (and cheap!) way to emulate a USB HID. I do wish the Teensy had mounting holes. I ended up not mounting it at all and letting it just hang loose, which should be fine, as it’s so lightweight. There’s a bit of electrical tape wrapped around the Teensy and the solder joints.

For the box, I wanted something metal, so it would be heavier and more sturdy than the typical plastic project box. Matt Gauger of Milwaukee Makerspace suggested I check out Mammoth Electronics, as they make boxes for guitar pedals. I ended up choosing their “tall” enclosure.

For the button, I really like this button over the one I ended up using, but it was too tall to fit in the project box. Unless you’re a “button snob” you probably won’t notice much difference between the two.

If you’ve got USB cables lying around, use one… otherwise, you can get one from Monoprice for less than a dollar. I pretty much buy all my cables from Monoprice.

As for the rubber feet, I picked some up at the local hardware store… as well as some black spray paint. (Note: If you are ordering the button from Sparkfun, just get the rubber feet from them too!)

The Button

There was one more item I needed. The button needs a 27.3 mm hole to fit into, which means I needed a hole that was 1.07480315 inches wide. Well, 1.07480315 inches is pretty close to 1.0 inches, so I ended up getting an Ace Bi-Metal Variable Pitch Hole Saw. (The link is not the exact one that I got. I ended up getting mine at the local Ace Hardware store.)

As for the process, the Teensy part took a small amount of time, (see the AWESOME Button) and the drilling was a little tricky, as the 1.0 inch hole was just slightly too small. A bit of creative drilling with a regular drill bit fixed that though. The spray painting was the real time consuming part of it all. As for the assembly, I originally envisioned mounting the Teensy on the bottom plate of the box, and having a hole where the USB connector would be accessible, but I ended up going with what you see in the photo. (I just used the Dremel to cut a small groove for the cable to fit into.)

And why do I need a yellow button that can emulate a key being pressed? Well, sometimes you just need a yellow button that can emulate a key being pressed…

The Button

Note: A number of people have asked for the code I used, and even though it is in the comments, I thought I should post it in here as well.

/*
 * Button.pde
 */

void setup() {
  Serial.begin(9600);
  pinMode(10, INPUT_PULLUP);
  delay(500);
}

void loop() {
  if (digitalRead(10) == HIGH) {
    delay(10);
  } else {
    Keyboard.print(" "); // we print a space
    delay(1000);
  }
  delay(10);
}

« Older Entries |

buy the button:

Buy The Button

recently at:


top recent artists: