Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Can you change the USB type from within a sketch?

  1. #1

    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?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,236
    Quote Originally Posted by bLackburst View Post
    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.

  3. #3
    Roger that, thanks Paul.

  4. #4
    Member
    Join Date
    Jan 2014
    Location
    London, UK
    Posts
    75
    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...

  5. #5
    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
  •