jonas.deforche
Member
Hey guys,
I'm working on a big project using serial data and a joystick.
I use windows 10 and a teensy 3.6.
Apparently I have major problems when I'm using Serial/Keyboard/Mouse/Joystick mode.
Windows doesn't recognize the joystick on a proper way.
So I minimized my program because I don't want you guys to skip through a lot of code.
So i have this small project:
If I use USB mode Serial/Keyboard/Mouse/Joystick, I can use serial data but windows doesn't recognize my Joystick in a proper way. I can't use buttons and my axes are gone.
If I use USB mode Keyboard/Mouse/Joystick, I can use my joystick in the right way but then i don't have acces to my serial data.
So I made a little video of this:
and here a picture of this simple project:
Anyone know how to fix this problem?
Is this Windows related or is this a problem on the teensy 3.6?
Thx in advance!
Greetz, Jonas
I'm working on a big project using serial data and a joystick.
I use windows 10 and a teensy 3.6.
Apparently I have major problems when I'm using Serial/Keyboard/Mouse/Joystick mode.
Windows doesn't recognize the joystick on a proper way.
So I minimized my program because I don't want you guys to skip through a lot of code.
So i have this small project:
Code:
//************************************************** ********************************************//
// PROBLEM WITH JOYSTICK ON USB MODE: SERIAL/KEYBOARD/MOUSE/JOYSTICK //
// SIMPLE PROGRAM ILLUSTRATES PROBLEM ON DIFFERENT USB MODES /// Programmed By Jonas Deforche //
// CONNECTIONS : ONE BUTTON ON PIN NUMBER 2 //
//************************************************** ********************************************//
#include <stdio.h> // Including library
#define SLOWPROGRAM 100 // IF PROGRAM GOES TO FAST // ADDING A DELAY.
#define BUTTON1 2 // PIN FOR BUTTON1
const long baudRate = 256000; // initialize Baudrate for serial data.
//************************************************** ***********************************************
//************************************************** ***********************************************
void setup() {
Serial.begin(baudRate); // OPEN serial dataport.
Keyboard.begin(); // Initialize keyBoard INPUT.
pinMode(BUTTON1,INPUT); // Digital input BUTTON 1
}
void loop() {
buttons(); // TEST JOYSTICK BUTTON
delay(SLOWPROGRAM); // Add delay, process go to fast.
}
void buttons(){
Joystick.button(1, digitalRead(BUTTON1));
}
If I use USB mode Serial/Keyboard/Mouse/Joystick, I can use serial data but windows doesn't recognize my Joystick in a proper way. I can't use buttons and my axes are gone.
If I use USB mode Keyboard/Mouse/Joystick, I can use my joystick in the right way but then i don't have acces to my serial data.
So I made a little video of this:
and here a picture of this simple project:
Anyone know how to fix this problem?
Is this Windows related or is this a problem on the teensy 3.6?
Thx in advance!
Greetz, Jonas