Jump to content

Teensy++ 2.0 Help


24 replies to this topic

#1 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 26 August 2012 - 05:16 PM

Well, This might not be the best website to post this, but I know that some people on this fourm have had almost the exact same problems as I have while trying to make a MechPit.

After seeing Foust's awesome panels, I had to buy a Teensy++ 2.0 board for my (upcoming) MechPit. After geting it, downloading GenericHID and libusb, installing everything (hopefully correctly) I've got my computer to recognize my "MechPit." However, that's it. What do I do next? How do I get My computer (running Win7) to see it as a game controller and let me press buttons? I saw Foust said that he had trouble geting the program to run correctly. How did you, in the end, get everything to work?

Like I said, this website isn't the best website for asking these kind of questions, but I'm pretty sure someone else here has had similar problems to what I've got. Any help would be much appriecated!
Thanks!

Edited by Ranger207, 26 August 2012 - 05:16 PM.


#2 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 26 August 2012 - 06:44 PM

Couple of things.

Does the generichid application open?
Are you getting errors of any kind?
Have been able to program the Teensy?
What is the air speed of an unladen swallow?

#3 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 27 August 2012 - 06:07 AM

View PostFoust, on 26 August 2012 - 06:44 PM, said:

Couple of things.

Does the generichid application open?
Are you getting errors of any kind?
Have been able to program the Teensy?
What is the air speed of an unladen swallow?

1. Yes
2. When I first tried, I didn't have libusb installed and I got an error then.
3. Sort of... I can make a configuration in genericHID and "program" the teensy. I've got it on a breadboard so that when I press a button on the breadboard, a LED (seperate from the teensy) lights up.
4. Which kind, African or European?

#4 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 27 August 2012 - 07:40 AM

You might just need to change the properties of the teensy in generic hid to Usage>Generic Desktop Controls: Joystick

Like so
Posted Image

#5 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 27 August 2012 - 01:39 PM

That's what I needed! Thanks!

Next problem: AutoHotKey won't recognize button presses, even though Windows does.
Quick question: how do you have output? Say I want a LED to show whether or not I have a switch open or closed; is it possible to do that in GenericHID?

As always, thanks for your help!

#6 Propnut

    Member

  • PipPipPipPipPipPip
  • 278 posts
  • LocationMichigan

Posted 27 August 2012 - 02:01 PM

lol, just saw this thread. My .02....What he said ;) You will love the Teensy! I just finished a round..of a certain game...using the Thrustmaster FCS, TQS, and rudder pedals that I re-engineered using the Teensy++2.0. Smooth as silk and works perfectly. I set this one up for 6 axis and 36 buttons, the next one will use all 8 axis (and Imight turn on the other two from this Teensy) and 100 plus buttons (I figure a control panel for each separate flight sim and mech game). I am typing this on the Mechpit (see my Enclosed Mechpit thread for more details) PC right now. Not in the pit though, need a final sanding and then I can put the hardware in.

#7 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 27 August 2012 - 07:15 PM

View PostRanger207, on 27 August 2012 - 01:39 PM, said:

Next problem: AutoHotKey won't recognize button presses, even though Windows does.
Quick question: how do you have output? Say I want a LED to show whether or not I have a switch open or closed; is it possible to do that i


So say you press button 1. The joystick config shows button 1 pressed, but it does not trigger AHK? Is that correct?

To the LED question, I know you can drive some LEDs with GenericHid however the amout depends on what you already have drawing power from the Teensy. I haven't tried using generichid to monitor state on a switch so I do not have a good answer for that. I did plan on driving some LEDs off of the second pole on my switches from their own source.

I would imagine there is a way to do it with the teensy, I just don't know what it is. Yet.

#8 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 28 August 2012 - 06:05 AM

View PostFoust, on 27 August 2012 - 07:15 PM, said:


So say you press button 1. The joystick config shows button 1 pressed, but it does not trigger AHK? Is that correct?

Correct. While looking around in the AutoHotkey Help file, I found a joystick monitering script. It recognizes my T-Master HOTAS, and sees my Teensy, but does not recognize button presses from the Teensy.

Quote

I did plan on driving some LEDs off of the second pole on my switches from their own source.

Now that you mention that, I remember coming up with that soulution myself....

Thanks for all of your help!

Edited by Ranger207, 28 August 2012 - 06:05 AM.


#9 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 28 August 2012 - 07:10 AM

Could you post your AHK script?

I should add that scripting is really not my thing, but I did manage to get what I was trying to do to work so maybe I can be of some assistance,

#10 Propnut

    Member

  • PipPipPipPipPipPip
  • 278 posts
  • LocationMichigan

Posted 28 August 2012 - 07:16 AM

This might be a silly question but why bother using Autohotkey? SVMapper (free) recognizes far more buttons than even windows and allows easy programming for the buttons to keystrokes, including macros.

#11 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 28 August 2012 - 08:04 AM

The man has a good point.

I used AHK to add sounds to the keystrokes. Does svmapper have that functionality cause it would be awesome if it did.

#12 Frank War

    Member

  • PipPipPip
  • 55 posts
  • LocationAtlanta, Ga

Posted 28 August 2012 - 08:18 AM

View PostFoust, on 26 August 2012 - 06:44 PM, said:

What is the air speed of an unladen swallow?

African or European?

#13 Propnut

    Member

  • PipPipPipPipPipPip
  • 278 posts
  • LocationMichigan

Posted 28 August 2012 - 08:19 AM

Not sure, never tried to do such a thing. I guess if you have a program that plays a sound when a certain keystroke is pressed then yes, you can program a joystick key to be a keyboard key or macro of keys. But you would need a separate program for that. Interesting idea though, I would like "Powercore Activated" etc when I start up my mech, etc.

#14 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 28 August 2012 - 11:33 AM

View PostPropnut, on 28 August 2012 - 08:19 AM, said:

Not sure, never tried to do such a thing. I guess if you have a program that plays a sound when a certain keystroke is pressed then yes, you can program a joystick key to be a keyboard key or macro of keys. But you would need a separate program for that. Interesting idea though, I would like "Powercore Activated" etc when I start up my mech, etc.


This exact thing is what I use AHK for on my panels. If you have the audio file, AHK is the program to get it to play on key press. there are other options I'm sure, but AHK is pretty straight forward and light weight.

#15 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 28 August 2012 - 12:05 PM

View PostPropnut, on 28 August 2012 - 07:16 AM, said:

This might be a silly question but why bother using Autohotkey? SVMapper (free) recognizes far more buttons than even windows and allows easy programming for the buttons to keystrokes, including macros.

Hmmm... where do you get SVMapper?

#16 Propnut

    Member

  • PipPipPipPipPipPip
  • 278 posts
  • LocationMichigan

Posted 28 August 2012 - 12:44 PM

http://forums.eagle....ead.php?t=53091

#17 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 28 August 2012 - 03:57 PM

Thanks for the link, Propnut. Continuing the tradation of me bringing a problem back every time...

I'm now truing to get a single-throw, single-pole switch to work using SVMapper. It will sometimes recognize that I've flipped the switch, but then it will randomly switch it off, even though I haven't touched the switch. Any ideas?

As always, thank both of you for the help you've given me!

#18 Propnut

    Member

  • PipPipPipPipPipPip
  • 278 posts
  • LocationMichigan

Posted 28 August 2012 - 04:10 PM

Hmm....it should show a constant light "on state" if the toggle is flipped up. The cool thing is that you can set it up to toggle a single pulse on the up **** and another pulse for the **** down.

Could the toggle switch have a short?

Edited by Propnut, 28 August 2012 - 04:10 PM.


#19 Ranger207

    Member

  • PipPipPipPipPipPip
  • 485 posts
  • LocationI iz in ur matchez, killing ur battlemechz

Posted 28 August 2012 - 05:29 PM

View PostPropnut, on 28 August 2012 - 04:10 PM, said:

Hmm....it should show a constant light "on state" if the toggle is flipped up.

It does!... sometimes...

Quote

Could the toggle switch have a short?

Just tested it and nope, no short, which means that instead of a hardware problem in which I could just switch out the switch (heh heh) it's instead a software problem which means I'll just have to fiddle around until I find some obsure fourm post describing the solution to my problem...

#20 Foust

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 394 posts
  • LocationKentucky

Posted 28 August 2012 - 05:56 PM

Maybe not a short, have you tried applying pressure to the switch in the on direction? Does that turn the LED on?

Could be failing hardware.





8 user(s) are reading this topic

0 members, 8 guests, 0 anonymous users