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

Thread: Switch between midi and joystick mode, possible?

  1. #1
    Junior Member
    Join Date
    Jun 2020
    Posts
    6

    Switch between midi and joystick mode, possible?

    Hi,

    Looking into teensy LC for a button box, a matrix of buttons and rotation encoders.
    Mostly to control iracing, a race game. But I'm also in to Ableton, a music program.
    So my question is, is it possible to add a button and use it to switch the teensy between joystick and midi mode?

    (Did search but could not find the answer)

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,931
    Helped somebody do something once - booting with two unique USB DESC lists. Perhaps setup_early_hook() is called before usb_init() - IIRC it involved swapping out the array of descriptors in the hook so when the USB code started it followed the selected list.

    As done IIRC it was done before a restart and the EEPROM was updated with a value. In the hook EEPROM was read and the descriptor list was chosen and set for later use.

    It was almost 2 yrs back - quick search of the helper sketch used with that doesn't pop up - and also failed to find it with forum search so no help there ...

    Found the thread with BING search :: pjrc.com/threads/53608-Configure-USB-after-sketch-has-already-loaded

    Not noted what Teensy that was ... not sure if T_LC would end up being cramped on any resource ...

  3. #3
    Junior Member
    Join Date
    Jun 2020
    Posts
    6
    Thx for the info, I guess that means it's a technically yes, but for me a no

    I got frustrated coding for my arduino, that's why it's been collecting dust for years.

    A box full of simple on off buttons and a few encoders seems doable. But that stuff in your link seems complicated, not a clear cut command I can copy paste

    If I really need to I can always add a second teensy lc, wire everything to both, but only plug in one of the two teensy to the pc. One being a joystick device the other being midi device.

    Think I'll just keep it "simple" for a noob like me. Matrix of buttons with diodes between them to prevent ghosting. And hook up the encoders to the teensy ports that support interrupts seem to be the most answer thing I find. So gonna try and figure that out

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,931
    Indeed it is not standard supported behavior Like most things ... it can be made to work I suspect ... That poster got it working with the tips - but didn't post actual solution

    Using twin dedicated T_LC's certainly less complexity and work in the code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •