This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a remix of USB joystick sketch by Mark Bennett at the arduino hub: | |
// https://create.arduino.cc/projecthub/markbennettuk/throttle-quadrant-and-trim-wheel-d746e8 | |
// I use the Encoder library for my pitch trim wheel, limit the encoder internal counter to | |
// 0 to 1023 range in a crude way, and set that as the value for the trim axis. | |
// | |
// Update: read the potentiometer values three times to stabilize them a bit. | |
// Apparently there is a capacitor on the arduino that is shared by all | |
// analog input pins. This takes a short moment to recharge when you | |
// read another analog pin with a different voltage, thus the potentiometers | |
// were interfering with each other a bit. Doing a read (select the pin!), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a remix of USB joystick sketch by Mark Bennett at the arduino hub: | |
// https://create.arduino.cc/projecthub/markbennettuk/throttle-quadrant-and-trim-wheel-d746e8 | |
// I use the Encoder library for my pitch trim wheel, limit the encoder internal counter to | |
// 0 to 1023 range in a crude way, and set that as the value for the trim axis. | |
// | |
// Update: read the potentiometer values three times to stabilize them a bit. | |
// Apparently there is a capacitor on the arduino that is shared by all | |
// analog input pins. This takes a short moment to recharge when you | |
// read another analog pin with a different voltage, thus the potentiometers | |
// were interfering with each other a bit. Doing a read (select the pin!), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a remix of USB joystick sketch by Mark Bennett at the arduino hub: | |
// https://create.arduino.cc/projecthub/markbennettuk/throttle-quadrant-and-trim-wheel-d746e8 | |
// I just include the Encoder library for my pitch trim wheel, and | |
// compare the encoder values during the loop, and spew out 10 button | |
// click events for each encoder pulse (because MS Flight Simulator 2020 | |
// currently has ridiculously slow trim wheel input) | |
// | |
// Update: read the potentiometer values three times to stabilize them a bit. | |
// Apparently there is a capacitor on the arduino that is shared by all | |
// analog input pins. This takes a short moment to recharge when you |