Forum Rule: Always post complete source code & details to reproduce any issue!
-
Can you change the USB type from within a sketch?
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?
-
Senior Member

Originally Posted by
bLackburst
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...
-
I did wonder what "All of the above" means in the usb mode menu. Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules