Howto:Use Arduino with FlightGear

From FlightGear wiki
Revision as of 17:36, 25 October 2013 by BotFlightGear (talk | contribs) (Update forum links)
Jump to navigation Jump to search
Arduino LCD panel displaying speed, heading and altitude.

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. 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