Arduino controler
Posted: 16 Oct 2016, 20:00
Please read everything BEFORE commenting.
I know that Leo Bodnar boards are supported, but the simple fact is that they are somewhat limited in their capabilities.
For instance, the BBI-32 Button Box Interface - With Connectors (€35.97 / $40.15) will control "32 button / 16 rotary encoders / 11 BBI-32 rotary switch inputs".
That sounds great until you consider that it can't output to motors and LEDs, never mind 7 segment displays.
The Teensy 3.2 Arduino microprocessor controller (€35.97 / $24.55) is an input/output device that can act as any USB/HID/MIDI device controlling buttons, joysticks, stepper & servo motors, encoders, 7 segment LED displays, even work as a USB keyboard. Or just about anything (serial or analog) that you want to it do. Want it to play/control sounds through a speaker? It can do that too.
It has 27 Digital I/O pins, and 13 high res Analog inputs. And with cheap Shift Registers ($5.95 for 5) it can be chained together to control FAR MORE Inputs (buttons, etc). Cheap MAX7219 LED display drivers ($10 for 5) can do the same for 7 segment displays.
As far a using it to control FSX/P3d, that can be VERY easy.
This has been set up as an example, with only one button, to send the letter "g" as a keyboard input.
Of course you can set up as many keyboard inputs as you want, but I thought that I'd keep it simple.
And just how simple is this to program?
I didn't really program it. I just downloaded a keyboard example program.
This is it in it's entirety;
int buttonPin = 9; // Set a button to any pin, it doesn't matter all that much in this case
void setup()
{
pinMode(buttonPin, INPUT); // Set the "buttonPin" as an input
digitalWrite(buttonPin, HIGH); // Pull the button high (send power to that pin)
}
void loop()
{
if (digitalRead(buttonPin) == 0) // if the button goes low
{
Keyboard.write("g"); // send a 'g' to the computer (prepar3d in this case) via Keyboard HID
delay(1000); // delay so there aren't a kajillion g's
}
}
Adding more input pins (buttons/keyboard inputs) should be easy for everyone here to figure out.
The important thing is that you can ALSO use this Arduino to act as a series of joysticks with programmable buttons too.
Using the EXACT same breadboard setup, this is an example of the Teensy 3.2 being programmed as a joystick button in Prepar3d V3.
This is an example of the Teensy 3.2 being programmed as a joystick button in SPAD.neXt.
Again this isn't something that I wrote, this was just an example that came with the Teensy Arduino.
But sending input to FSX/P3d is not the problem.
What's needed is a better way to have FSX/P3d send data TO the Teensy.
Right now there are two programs that will send info TO Arduino's.
One is Link2fs Multi for FSX. It's creator was upset by a detractor and pretty much stopped developing the program in 2014.
The other program is MobiFlight (in English and auf Deutsch MobiFlight)
The problem with MobiFlight is that it's development is limited to one older, MUCH slower, and MUCH less capable, Arduino. Unfortunately, it's development seems to be somewhat stalled.
I'm simply reluctant to invest much time and effort in either program.
Sending button commands isn't a major problem, especially with SPAD.neXt already recognizing the Teensy as a USB/HID device.
Getting the readings from FSX/P3d and sending them TO 7 segment displays is where I'm hoping that SPAD.neXt can come in.
I know that Leo Bodnar boards are supported, but the simple fact is that they are somewhat limited in their capabilities.
For instance, the BBI-32 Button Box Interface - With Connectors (€35.97 / $40.15) will control "32 button / 16 rotary encoders / 11 BBI-32 rotary switch inputs".
That sounds great until you consider that it can't output to motors and LEDs, never mind 7 segment displays.
The Teensy 3.2 Arduino microprocessor controller (€35.97 / $24.55) is an input/output device that can act as any USB/HID/MIDI device controlling buttons, joysticks, stepper & servo motors, encoders, 7 segment LED displays, even work as a USB keyboard. Or just about anything (serial or analog) that you want to it do. Want it to play/control sounds through a speaker? It can do that too.
It has 27 Digital I/O pins, and 13 high res Analog inputs. And with cheap Shift Registers ($5.95 for 5) it can be chained together to control FAR MORE Inputs (buttons, etc). Cheap MAX7219 LED display drivers ($10 for 5) can do the same for 7 segment displays.
As far a using it to control FSX/P3d, that can be VERY easy.
This has been set up as an example, with only one button, to send the letter "g" as a keyboard input.
Of course you can set up as many keyboard inputs as you want, but I thought that I'd keep it simple.
And just how simple is this to program?
I didn't really program it. I just downloaded a keyboard example program.
This is it in it's entirety;
int buttonPin = 9; // Set a button to any pin, it doesn't matter all that much in this case
void setup()
{
pinMode(buttonPin, INPUT); // Set the "buttonPin" as an input
digitalWrite(buttonPin, HIGH); // Pull the button high (send power to that pin)
}
void loop()
{
if (digitalRead(buttonPin) == 0) // if the button goes low
{
Keyboard.write("g"); // send a 'g' to the computer (prepar3d in this case) via Keyboard HID
delay(1000); // delay so there aren't a kajillion g's
}
}
Adding more input pins (buttons/keyboard inputs) should be easy for everyone here to figure out.
The important thing is that you can ALSO use this Arduino to act as a series of joysticks with programmable buttons too.
Using the EXACT same breadboard setup, this is an example of the Teensy 3.2 being programmed as a joystick button in Prepar3d V3.
This is an example of the Teensy 3.2 being programmed as a joystick button in SPAD.neXt.
Again this isn't something that I wrote, this was just an example that came with the Teensy Arduino.
But sending input to FSX/P3d is not the problem.
What's needed is a better way to have FSX/P3d send data TO the Teensy.
Right now there are two programs that will send info TO Arduino's.
One is Link2fs Multi for FSX. It's creator was upset by a detractor and pretty much stopped developing the program in 2014.
The other program is MobiFlight (in English and auf Deutsch MobiFlight)
The problem with MobiFlight is that it's development is limited to one older, MUCH slower, and MUCH less capable, Arduino. Unfortunately, it's development seems to be somewhat stalled.
I'm simply reluctant to invest much time and effort in either program.
Sending button commands isn't a major problem, especially with SPAD.neXt already recognizing the Teensy as a USB/HID device.
Getting the readings from FSX/P3d and sending them TO 7 segment displays is where I'm hoping that SPAD.neXt can come in.