9/20/2023 0 Comments Flightgear throttleIn that way I can read the three positions with one analog input on the Arduino instead of using 2 digital inputs. ![]() Both ON positions are tied with a 6k-8k resistor and to an analog input on the Arduino. They are way cheaper than rotary switches. The OHpanel is still one way: none of the FlightGear systems communicate to it.įor the rotary switches, I used three way toggle switches (ON-OFF-ON) for now. If none of the electrical power switches is on (battery, APU Gen en Ext Pwr 1 and 2 implemented), then all the leds go dark. The brightness of the LED's depends on the state of the IND LTS switch: DIM gives a PWM of 50, BRT sets them high and TEST lets them blink. This makes the corresponding LED of a button light up if the Led output commands so. That transistor is tied with the collector to one of the ledpwm outputs (see code) and to an LED with the emitter. The output of the push buttons is tied to both an Arduino input and the base of a transistor. The panel is still very basic: I used cheap push buttons with a locking mechanism for the push buttons and put a green led next to them. Then I start FlightGear with this line in the settings tab: -generic=serial,in,10,\com4,9600,ArduinoOHPanel FG nasal file that loads on startup: Arduino.nas (put in your fgdata/nasal folder) FG protocol file: ArduinoOHPanel.xml (put in your fgdata/protocol folder) I programmed my Arduino Mega 2560 for my Boeing 777 Overhead panel with this code: ![]() Tom tom_nl Posts: 84 Joined: Tue 11:41 am Location: Netherlands OS: OS X Big Sur The quadrant is certainly better than my own design (as you'd expect), but with hindsight and experience I could build something better than my first design now (as I proved to myself with my trim wheel design). My design worked fine, but In the end I bought a Saitek yoke and quadrant combo (mainly because I wanted a yoke - the quadrant was a bonus ). If you do need a Pro Micro clones can be had for less than 3 Euro on Aliexpress if your'e prepared to wait. In my experience it's easier to interface once you've got the code working as it appears as a USB game controller. I found that setting the serial rate to 38400 works best as it gives the arduino more time to do things between serial sends.Ģ) If the Teensy supports it, use the Nicohood USB HID library - the Teensy can then be programmed to appear as a joystick. I'll try to find and post the pictures if you're interested.įor the interfacing, there's two approaches you can follow:ġ) use the generic protocol through serial, I've done this with the panel I built, and updating at 25Hz is no problem if you're clever with the code. I built my own quadrant 3D printed from my own design, but using an arduino instead. Just connect them in the correct way and they will provide the same result I didn't get a connection to my Arduino board until I used \com4 instead of \COM4. The config line to load your protocol file is case sensitive. This is most often the case after you 've used the Arduino IDE to upload some new code or to use the serial monitor. ![]() Use this program to connect and disconnect (only a second is enough) to the serial port of your board if FlightGear hangs on 'finalizing position' during startup. If you 're using Windows, FlightGear might have issues connecting to your serial port. Experiment with different frequencies to get the best result. This reduces the fps hit FlightGear experiences. Use both the delay() and the tTimeout() functions. 10 Hz is more than enough to get an instantaneous feeling. don't update too frequently, as that brings FlightGear's framerate into single digits. I've built an overhead panel with the Arduino Mega in the last month. I don't know the exact board, but if it is Arduino compatible, it should be trivial to connect it to FlightGear over serial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |