Jump to content

[Version 1] Execute Programs In Windows

Recommended Posts

I wonder if it's possible to create a program in a PC with Windows and execute it from a Teensy or some kind of USB programable device without the USER interfering (not the noob method of autorun or autoplay).

Link to post
Share on other sites


the teensy is a mini computer, it can be anything the problem is that it has those descriptos by default...

It's evident that here there are only electronic noobs...

yes you can add an SD card, but the device in it's stock form is a HID; keyboard and a mouse... programmable micro controller as apposed to computer. It's evident that we have someone with a big (know it all) ego here..

Edited by Mr-Protocol
Link to post
Share on other sites

Hi, Paul here.... the guy who designed Teensy and wrote Teensyduino.

Teensy is based on the Atmel AVR ATMEGA32U4 microcontroller, which has a fully generic (up to 7 endpoints) USB device controller built in. So in theory, you could program it to be virtually anything. In practice, writing the USB driver code is a LOT of work, starting with the 600 page USB spec and many other necessary USB documents (the 600 page spec is only the basic stuff, not how any particular device actually uses it...) Only about half a dozen people appear to have ever written such code for these AVR chips, and only 3 of these code bases in widespread use: Atmel's sample code written by some unrecognized author, my code, and Dean Camera's LUFA library. Atmel's code isn't worth considering (and Atmel has hired Dean recently). Dean and I have nearly opposite coding styles, where Dean uses lots of C structures and syntax and very modularized style, and attempts to craft interfaces that expose all possible options with maximum flexibility. That's ideal for large projects and experienced C programmers. My style involves minimal amount of code without lots of special syntax or abstractions, and simplified interfaces that expose only the most commonly needed functions. My style works well for Arduino, and I've gone to great lengths to give you the simplest, most Arduino-like experience possible, but without being limited to only serial COM ports as Arduino is. If you want access to a lot more features, Dean's code is the way to go. Or write you own!

It could be said that Teensy is natively a HID device, because it appears as HID when you're programming it with the Teensy Loader program. However, it is not a HID keyboard or mouse, but rather a "vendor specific" HID device. The "documentation" is embedded within the open source code command line tools, which it at this page:


But what matters is the type of device Teensy is when your code runs, and that's up to you. Most people program Teensy using Arduino, of course with the Teensyduino add-on package installed. The type of USB device Teensy will become depends on the setting you've selected in the Tools > USB Type menu. The current version of Teensyduino provides five choices:

1: Serial

2: Keyboard + Mouse + Joystick

3: Disk(Internal) + Keyboard

4: Disk(SD Card) + Keyboard


Really, it's 4 USB choices, since 3 and 4 are identical, except for which media is used to implement the disk. The menu defaults to Serial, because that's what Arduino is.

The MIDI type, and Joystick in #2, are relatively new. If you're running an old version of Teensyduino, the latest gives you more options. :-)

Over time, I'll probably add a few more choices to this menu. But that is a slow process. I've still got some unfinished business in the disk types, to facilitate sharing the media between the PC and your own code, which might want to read data the PC has stored, or write data for the PC to later see.

If you use my C-based examples, there's also a Raw HID program, which is intended for building custom USB projects that work together with only your own custom written application. That too is on my to-do list to expand someday. But much of my coding time ends up going to porting various Arduino libraries. So much code to write... never enough time....

If you use Dean Camera's LUFA code, which is only C-based (doesn't work with Arduino), there are a few other choices, like a RNDIS-based network interface.

So for the disk type, both Teensyduino and LUFA support USB disk types. To be perfectly honest, the disk type in Teensyduino is still under construction. 0.96(beta) adds an API for managing the PC's access to the media, but it isn't documented (other than the source code, which is in hardware/teensy/cores inside Arduino). It still has bugs, which is why I haven't documented it yet. I'll make it work well eventually.

That API, and really everything about Teensyduino, is intended to facilitate building electronic projects. Examples might be a temperature logger, which records temperature data and the PC can later read it. Or perhaps a simple robotic machine controller, where the PC might write a file with instructions on how to move the motors. If you're building those sorts of things, I want to help you. If your aim is "security" related, especially techniques to analyze or compromise systems, I will neither help nor hinder. But I hope you'll carefully consider the legal and ethical ramifications of any such work, and always act responsibly.

Hopefully this long-winded post at least helps clear up any questions about what type of USB device Teensy really is?

Edited by Paul Stoffregen
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...