Howto:Use Arduino with FlightGear

From FlightGear wiki
Revision as of 12:22, 20 December 2014 by J Maverick 16 (Talk | contribs) (Initial description updated)

Jump to: navigation, search
Arduino LCD panel displaying speed, heading and altitude.

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware (consisting of a board designed around an 8-bit or a 32-bit microcontroller) and software (based on an integrated development environment (IDE)). FlightGear's IO interface allows easy development of hardware that can improve the immersion and realism of the simulation. The output protocols allow hardware to response to simulation data (like shown in the image on the right), while the input protocol allows FlightGear to reply to hardware events (eg. on the press of a button).

Display/Generic protocol Example by rubdos

Rubdos (Ruben De Smet) has built an example using the Generic Protocol and an Arduino Mega 2560. The code used to control the Arduino with generic protocol was:

<?xml version="1.0"?>

It is a simple plaintext protocol, which can easily be parsed by an Arduino. The code used on the Arduino is available on github as a gist: [1]

As hardware, five seven segment displays were used, multiplexed straight on the Arduino device. In production, you'd rather use some 74HC595 or other shift register chips to drive them, to unload the Arduino and have more current. A demo is uploaded to youtube, with voiceover in which the display shows the RPM of the first engine of (the single engine) DR400: [2]

Related content

External links