Regnad517 Posted December 24, 2017 Posted December 24, 2017 Just curious if anyone has got a 14 seg working with dcs bios? Best I have so far is random (Im sure they are not random but they are not proper) characters. I'm trying to use a 14 segment for my Tacan so the X looks better but am having trouble incorporating it in dcs bios.
FSFIan Posted December 24, 2017 Posted December 24, 2017 Do you have a datasheet for your display? That should show you which pins correspond to which segments. If you post a link to a datasheet, I can take a look and tell you how you have to wire it up. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Regnad517 Posted December 24, 2017 Author Posted December 24, 2017 Well Im pretty sure I have it wired up OK because I get it working outside of dcs-bios, but the code is much more complex than the 7 segment code is so I'm having trouble figuring out how to implement the actual Tacan output https://learn.adafruit.com/adafruit-led-backpack/0-54-alphanumeric thats the one I have with the backpack
FSFIan Posted December 24, 2017 Posted December 24, 2017 Try the following code. I don't have a LED backpack to test with, but the Adafruit library had good examples and I verified that it compiles, so it probably works. If the digits are displayed in the wrong order, you'll need to reverse the indices in onTacanChannelChange(). // include Adafruit LED Backpack library #include <Wire.h> #include <Adafruit_GFX.h> #include "Adafruit_LEDBackpack.h" // include DCS-BIOS Arduino library #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" // display instance Adafruit_AlphaNum4 alpha4 = Adafruit_AlphaNum4(); void onTacanChannelChange(char* newValue) { // when we get new data for the TACAN channel, write it to the display // you might need to reverse the display (go from newValue[3] to // newValue[0]) if it is the wrong way around. alpha4.writeDigitAscii(0, newValue[0]); alpha4.writeDigitAscii(1, newValue[1]); alpha4.writeDigitAscii(2, newValue[2]); alpha4.writeDigitAscii(3, newValue[3]); alpha4.writeDisplay(); } DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange); void setup() { // initialize display alpha4.begin(0x70); // write something to the display // so you see something before data is received alpha4.writeDigitAscii(0, 'A'); alpha4.writeDigitAscii(1, 'B'); alpha4.writeDigitAscii(2, 'C'); alpha4.writeDigitAscii(3, 'D'); alpha4.writeDisplay(); DcsBios::setup(); } void loop() { DcsBios::loop(); } DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Regnad517 Posted December 24, 2017 Author Posted December 24, 2017 That worked perfectly!! About 90% of the programming is now down, now we are molding, cutting, and wiring. Cant wait to share some pics of what you helped us build. Thanks yet again Ian, you're da man!
Recommended Posts