Question about Teensy

Status
Not open for further replies.
I’m considering making a USB emergency boot controller for my Mac to use when during the rare times I have to do diagnostics and my bluetooth keyboard isn’t connecting. I’d rather not have to store a wired keyboard somewhere.

I’m thinking of a small hand held 5 button trigger designed like the Wii Nunchuck that can be plugged in during troubleshooting. I know I’ll have to figure out the programming for this and I’ve found some good guides online for it but I am writing to ask about the Teensy controller. Would that be the device I would need to just create a device that each button can combine certain keyboard presses? Example: Button 1 (Flash PRAM) = Option+CMD+P+R. Or does the Teensy require all the individual keys to exist separately? If the Teensy would work for this and it is just a matter of programming would it be able to accept signals from a controller circuit like the one in the Wii Nunchuck and just translate each key press into the needed combination of keyboard signals? Any advice you could provide would be appreciated.

Wii Nunchuck.jpg
 
Last edited:
You might use one single button to trigger a combination of keys or even key sequences. That's only a question of your software engineering.
 
Example: Button 1 (Flash PRAM) = Option+CMD+P+R. Or does the Teensy require all the individual keys to exist separately?

There are 2 ways you can send keystrokes. The simple Keyboard.print() generally sends 1 key at a time, as if you were (very rapidly) typing ordinary text. To send special combinations, you would use Keyboard.press() and Keyboard.release(). That's more code, but you can precisely control the order. Details here:

https://www.pjrc.com/teensy/td_keyboard.html


If the Teensy would work for this and it is just a matter of programming would the it be able to accept signals from a controller circuit like the one in the Wii Nunchuck and just translated each key press into the needed combination of keyboard signals?

Several people have connected WII Nunchucks. It's done using the I2C pins.
 
Thanks PaulStroffregen:D Would the Teensy 2.0 be sufficient for something like this? I assume the I2C pins you are referring to are on the Wii Nunchuck circuit board? I don't see any of the Teensy boards listed with pins labeled I2C.
 
i2c is an interface that most micro controllers support

https://www.sparkfun.com/news/2366
or more complete
https://en.wikipedia.org/wiki/I²C

In the Teensy case look for Serial Clock (SCL) and serial Data(SDA), colour coded purple on the newer Teensyies (which may have more than one+alternates so find SCL0/SDA0 in black.

You can do this on a Teensy 2.0, but be aware it's a fairly old device so you may find current examples which will not work. Also if shopping online a fair number of Teensy2 and Teensy 2++ are counterfeit, some work, some don't and many of them come with exciting features buried in the bootloader that make them easy to brick. If this is your first go at Arduino suggest paying the extra to buy from a known reseller.
 
Thanks for the heads up on the counterfeit ones. I figured I would order it from this site's store or Amazon since they sell there too. I'll take measurements and see if the Teensy 3.2 will fit in the Wii Nunchuck handle and order that one if it does.
 
Thanks, I'll try the LC since it is the same size as the 2.0 and should fit fine. I assume that the USB should provide any necessary power and the pins shown in this diagram are just optional?

card7b_rev1.png
 
Note, if you are doing i2c on Teensy 3.x or LC, you may need to add pull-up resistors between each of the SCL and SDA pins and 3.3v. If your device has pull-up resistors, you don't need to add extra ones in the Teensy. For normal Teensy i2c buses, you would want 2.2K resistors.
 
Thanks for the heads up, MichaelMeisser. I assume that it doesn't matter which 3V pin I use since there 2? They both serve the same function right?
 
Yes, the pins labeled 3.3V in both spots are the same regulated down from the 5V that comes in over the USB cable (or VIN).
 
Last edited:
Thanks that helps, there isn't much documentation on these that I've seen detailing all the pin functions. All the diagrams seem designed for people who already know what they are doing. Novices like me just are winging it.. :)
 
There is a world of details and documentation - be careful of phrasing somebody will point you to the thousands of pages of chip manuals and the schematic on PJRC.com.

The forum has helpful folks and info - if you know how and where to look { Bing or Google are best to search the Forum } or ask good questions. The Teensy ( other than being 3.3V and using a different 32 bit ARM processor versus 8 bit AVR ) is very compatible with any info and details following general Arduino library and pin usage.
 
Very compatible if you stick to libraries. Arduino folks often write code that accesses hardware registers with short cryptic names in all caps. This stuff differs between processors and is a bit tricky anyhow.
 
Status
Not open for further replies.
Back
Top