Can you change the USB type from within a sketch?

Status
Not open for further replies.

bLackburst

Active member
I'm thinking about using a config file on an sd card that sets up the teensy according to some lines in a csv or text file. Is it possible to have these arguments configure the USB between modes such as USB-midi and USB-Keyboard?
 
Is it possible to have these arguments configure the USB between modes such as USB-midi and USB-Keyboard?

This depends on the scope of "possible".

Using the USB code Teensyduino provides, no, this isn't possible. That code is designed to be configured at compile time, based on the setting in Tools > USB Type.

If you go to quite a lot of work to edit the USB code (or include a copy all that code in your program), then this would be "possible". The hardware could do it, with the right code. But only "possible" through a lot of work.
 
A more useful idea might be for the Teensy to identify itself as more than one type of USB device at the same time... not sure how possible that is though...
 
Status
Not open for further replies.
Back
Top