More info about this articleand curiosity workshop on Patreon.comLast week I came across a new plugin for XPLane and did some tests which weresimply wonderfull. Writing minimal code and controlling datarefs and sending commandsto XPlane 11. Datarefs can be read, write or readwrite. You can add a series of datarefsto query in combination with commands if you like. My tests involved reading the state of the beacon switch (sample code included withthe download) and reading the NAV and COM frequencies out of XPLane anddisplay them on my MicroDrivers.First the included sample, reading the beacon switch state.#include <arduino.h>#include <XPLDirect.h> // include file for the X-plane direct interfaceXPLDirect Xinterface(&Serial); // create an instance of it//in setupSerial.begin(XPLDIRECT_BAUDRATE); // start serial interface, dont change Xinterface.begin("Xplane Demo"); // needed for initialization//the dataref you want to queryXinterface.registerDataRef("sim/cockpit2/switches/beacon_on", XPL_READ, 100, 0, &beacon); //in the loop you need to add following, needs to run every cycleXinterface.xloop(); In the loop part you can do whatever you would like to do, simple normal Arduino code, nothing fancy.My second try was retrieving the NAV data out of XPLane via the plugin and display these onmy MicroDrivers. I used previously created code (available on the website) to drive the MicroDrivers and added the above code to adapt and send the retrieved values to the displays. It was very direct and simple, change the frequency in XPlane and the result was immediately visible on the MicroDrivers without any lag. Apart from the code above the only thing needed was uncomment the serial communication and add the line ToDisplay.A = nav1_stb; that is all. ToDisplay.A = nav1_stb; ToDisplay.B = nav1;
To get the plugin and Arduino library please go to Patreon/curiosityworkshopTo receive the Arduino sketch for NAV displays, request it at