Teensy 2.0 as joystick not working

Status
Not open for further replies.

deepo

New member
Hi!

I just received a Teensy 2.0 today, and downloaded the Teensyduino installer, and succeeded to upload the fast/slow blink sketches from Arduino IDE 1.8.5.
I then tried to follow this guide: https://www.pjrc.com/teensy/td_joystick.html

The Arduino IDE does not have a Joystick option under Tools > USB Type. I only have a Keyboard + Mouse + Joystick option, so I selected that.
The Board is set to Teensy 2.0. The CPU speed is set to 16 MHz

I then tried this sketch:
Code:
int led = 11;

void setup() {
  pinMode(led, OUTPUT);
}

void loop() {
  Joystick.X(512);            // "value" is from 0 to 1023
  Joystick.Y(512);            //   512 is resting position
  
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  Joystick.button(1, 1);
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  Joystick.button(1, 0);
  delay(1000);               // wait for a second
}

When the sketch is uploaded I do get a Teensy Keyboard/Mouse/Joystick device on Win7 under Devices and Printers, but the Properties of the Game controller settings of the Teensy device indicates that it doesn't work:

TeensyGamepad.png

What am I doing wrong?

/Mogens
 
FWIW, your sketch worked for me on T2.0 hooking to Win 10. joystick properties shows button toggling. If i replace 512 with analogRead(A0) and analogRead(A1) (unattached, yields random), i can see that cross-hair randomly moving ...
Using Arduino 1.8.4/1.40

do you have genuine PJRC T2.0 or counterfeit? (have photo?)
 
Well.. I'm curious.
What is the difference between a genuine and a counterfeit board?
I mean provided that the counterfeiters got the PCB layout right, what's left to differ?
Does the chip contain any code that only PJRC has access to?

/Mogens
 
That board is definitely a counterfeit. But if the code uploads, I can't understand why it wouldn't work, unless there's something seriously wrong with the hardware.
 
Status
Not open for further replies.
Back
Top