Hi all, I have been playing with the teensy joystick interface and I have it all working fine with X,Y, Z Rotation and 2 Sliders but the Z axis will not budge. It's not a pin/wiring issue and i'm just using the basic Joystick example slightly modified. It seems that the USB 'data' is wrong in the back end of the IDE - Can someone verify?
ZRotate, sliderLeft and sliderRight all read the value but Z does not!
I tried to have a look in older versions of TeensyDuino but it's not easy to extract from the .exe
Code:
void setup() {
// pinMode(0, INPUT_PULLUP);
// pinMode(1, INPUT_PULLUP);
}
void loop() {
// read analog inputs and set X-Y position
Joystick.X(analogRead(0));
Joystick.Y(analogRead(1));
Joystick.Z(analogRead(5));
Joystick.Zrotate(analogRead(5));
Joystick.sliderLeft(analogRead(5));
Joystick.sliderRight(analogRead(5));
// a brief delay, so this runs 20 times per second
delay(50);
}
ZRotate, sliderLeft and sliderRight all read the value but Z does not!
I tried to have a look in older versions of TeensyDuino but it's not easy to extract from the .exe