MrLouisMC Posted July 19, 2022 Posted July 19, 2022 Hello, I've been working on a simpit for the F18C and understand the basic principles of how to connect everything with Arduino but recently I have some problems getting the 7 segment displays to work for my UFC. As a test I'd like to show the first row of 4 characters on my 4 7 segment displays. When I try this however the characters do not display correctly, this is clearly a fault in my coding (a simple counter works without DCS-bios) but I can't figure out where it went wrong. I am using an Arduino NANO with DCS-BIOS. Code: #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include "SevSeg.h" SevSeg sevseg; //Instantiate a seven segment controller object void onUfcComm1DisplayChange(char* newValue) { sevseg.setChars(newValue); } DcsBios::StringBuffer<2> ufcComm1DisplayBuffer(0x7424, onUfcComm1DisplayChange); void setup() { byte numDigits = 4; byte digitPins[] = {2, 3, 4, 5}; byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13}; bool resistorsOnSegments = false; // 'false' means resistors are on digit pins byte hardwareConfig = COMMON_ANODE; // See README.md for options bool updateWithDelays = false; // Default 'false' is Recommended bool leadingZeros = true; // Use 'true' if you'd like to keep the leading zeros bool disableDecPoint = false; // Use 'true' if your decimal point doesn't exist or isn't connected sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments, updateWithDelays, leadingZeros, disableDecPoint); DcsBios::setup(); } void loop() { sevseg.refreshDisplay(); // Must run repeatedly DcsBios::loop(); } Wishlist: F16, F15E Owned Modules: F18C, F14B, F15C, A10A My rig: CPU: I7-7700K @5Ghz - RAM: 32GB DDR4-3000 Vengeance RGB - GPU: GTX 1050ti OC - MB: Asus Formula IX - Storage: Samsung 960 pro m.2 Nvme 512gb, 2x500Gb WD Blue SSD's, WD Black 2TB HDD Setup: Thrustmaster Hotas Warthog + Thrustmaster TFRP - Triple Screen
No1sonuk Posted July 20, 2022 Posted July 20, 2022 Not sure if it's the case, but I would have thought the F18 displays send ASCII characters from DCS because some of them are text. This would mean the zero would be sent from DCS as 40 in decimal, one is 41 and so on. I can't see if your code accounts for that.
Recommended Posts