Hi guys.
My first post here, so I guess the drinks are on me I've just started exploring the delightful world of Teensy having had some experience with Arduino and also PIC devices (although not for a few years), and very impressed and inspired so far.
As a first experiment I've put together a little box with a Teensy LC, a few pots (50k linear), switches and a rotary encoder which I have initially set up to function as an extra joystick controller (for flight simulator).
However, I've hit upon an issue with the scaling of the analog axis when connected to Linux. I've seached through the forums here and haven't seen mention of anything similar, but apologies if this is a known issue.
I've used simple code to translate the pots:
When connected to my Windows PC this functions as expected and the pot gives control over it's full range. However, when plugged into a Linux machine the joystick axis only operates across a reduced range of the pot (approx 9 o'clock to 3 o'clock). In other words the axis value, as seen in the joystick control panel, is at a minimum when pot is at 9oc and maximum at 3oc. This greatly reduces the usablity.
I can fix this by scaling the pot in code:
Which then gives me full range back, but then will no longer work correctly when connected to Wndows.
I've checked this on both my Linux desktop (running KDE Plasma on Arch with Linux kernel 4.14.14) and my laptop (running Manjaro KDE (which is Arch based) and again Linux 4.14.14) and see the same on both. Teensy coding was done on Arduino 1.8.5 / Teensduino 1.41.
Have I missed something? Or is there perhaps workaround?
Thanks.
My first post here, so I guess the drinks are on me I've just started exploring the delightful world of Teensy having had some experience with Arduino and also PIC devices (although not for a few years), and very impressed and inspired so far.
As a first experiment I've put together a little box with a Teensy LC, a few pots (50k linear), switches and a rotary encoder which I have initially set up to function as an extra joystick controller (for flight simulator).
However, I've hit upon an issue with the scaling of the analog axis when connected to Linux. I've seached through the forums here and haven't seen mention of anything similar, but apologies if this is a known issue.
I've used simple code to translate the pots:
Code:
Joystick.X(analogRead(potPIN[0]));
When connected to my Windows PC this functions as expected and the pot gives control over it's full range. However, when plugged into a Linux machine the joystick axis only operates across a reduced range of the pot (approx 9 o'clock to 3 o'clock). In other words the axis value, as seen in the joystick control panel, is at a minimum when pot is at 9oc and maximum at 3oc. This greatly reduces the usablity.
I can fix this by scaling the pot in code:
Code:
Joystick.X(map(analogRead(potPIN[0]), 0, 1023, 60, 960));
Which then gives me full range back, but then will no longer work correctly when connected to Wndows.
I've checked this on both my Linux desktop (running KDE Plasma on Arch with Linux kernel 4.14.14) and my laptop (running Manjaro KDE (which is Arch based) and again Linux 4.14.14) and see the same on both. Teensy coding was done on Arduino 1.8.5 / Teensduino 1.41.
Have I missed something? Or is there perhaps workaround?
Thanks.