sharkfin61 Posted December 4, 2024 Posted December 4, 2024 (edited) Fellow simmers, I starting to climb walls because I can't figure out how to shift the numbers in a 8 digit 7segment lcd into position. due to the cutout in my UHF panel, I have to have the numbers on position _234(.)567_ . Lcd is a 3461-AS array with a MAX7219 IC. I tried it with @CraigS (mysimpit.co.uk) code like this: //SECOND - 8 DIGIT 7 SEGMENT DISPLAY - UHF RADIO (CODE) void onUhfFrequencyChange(char* newValue) { lc2.setChar(0,7,newValue[0],false); lc2.setChar(0,6,newValue[1],false); lc2.setChar(0,5,newValue[2],false); lc2.setChar(0,4,newValue[3],true); lc2.setChar(0,3,newValue[4],false); lc2.setChar(0,2,newValue[5],false); lc2.setChar(0,1,newValue[6],false); } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); and I got this: Is there codewise something I can do, to shift each of the first 3 numbers one position to the right? Edited December 13, 2024 by sharkfin61 Problem solved Loads do it on the fly! Royal Bavarian Airforce all the way RIG: RYZEN 7 5800X3D~ ZOTAC 4080 Super ~ AORUS X570S Elite AX ~64 GB Corsair Venegance DDR-4 3600 ~ BeQuiet AIO Silent loop 2 360 watercooled ~ Samsung 890 Pro M.2 (2TB) + 870 EVO (1TB) SSD ~ WIN 10 64-bit ~ AOC 31.5" Gaming 144Hz Display ~ DelanClip@TrackIR 5 ~ TM Warthog no.2 ~Saitek rudder pedals~ 2 TM MFDs on 2nd 27"display ~ Buddyfox A-10 UFC ~ CDU/AAP panel via DCSBios ~ ARC-210 (soldering WIP) ~ QUEST 3
Vinc_Vega Posted December 4, 2024 Posted December 4, 2024 (edited) @sharkfin61 Char number 3 of the string (from left to right, first is 0) may be spared, because it's the decimal point. Therefore, the colon of respective digit can be switched on (set to true). Count the displays from right (0) to left (7). try something like this for "_012.456_" //SECOND - 8 DIGIT 7 SEGMENT DISPLAY - UHF RADIO (CODE) void onUhfFrequencyChange(char* newValue) { lc2.setChar(0,7," ",false); // display 7 is off (line may be deleted) lc2.setChar(0,6,newValue[0],false); lc2.setChar(0,5,newValue[1],false); lc2.setChar(0,4,newValue[2],true); lc2.setChar(0,3,newValue[4],false); lc2.setChar(0,2,newValue[5],false); lc2.setChar(0,1,newValue[6],false); lc2.setChar(0,0," ",false); // display 0 is off (line may be deleted) } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); Regards, Vinc Edited December 4, 2024 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
sharkfin61 Posted December 4, 2024 Author Posted December 4, 2024 (edited) Thank you, Vinc! So, as I understand, the number in square brackets is the position of the digit in the array?! My saviour (as always) Will try tomorrow, reporting back. Edited December 4, 2024 by sharkfin61 Loads do it on the fly! Royal Bavarian Airforce all the way RIG: RYZEN 7 5800X3D~ ZOTAC 4080 Super ~ AORUS X570S Elite AX ~64 GB Corsair Venegance DDR-4 3600 ~ BeQuiet AIO Silent loop 2 360 watercooled ~ Samsung 890 Pro M.2 (2TB) + 870 EVO (1TB) SSD ~ WIN 10 64-bit ~ AOC 31.5" Gaming 144Hz Display ~ DelanClip@TrackIR 5 ~ TM Warthog no.2 ~Saitek rudder pedals~ 2 TM MFDs on 2nd 27"display ~ Buddyfox A-10 UFC ~ CDU/AAP panel via DCSBios ~ ARC-210 (soldering WIP) ~ QUEST 3
Vinc_Vega Posted December 4, 2024 Posted December 4, 2024 (edited) Yes, the number in square brackets is the position within the array (frequency string). Second number in the setChar command is the digit of the display. (First number is the number of the Max7219 chip, as you may use 8 of it. If you only have one chip, number is always 0) Best greetings my friend! Edited December 4, 2024 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
sharkfin61 Posted December 5, 2024 Author Posted December 5, 2024 @Vinc_Vega you are a legend! The only thing I had to do is to shift also the "A10c" from @CraigS code (to see if the display is working on start-up) to the right position. //SECOND - 8 DIGIT 7 SEGMENT DISPLAY - UHF RADIO (CODE) MAX7219 BOOT CODE WHILST AWAITING SOCAT DATA STREAM // lc2.setChar(0,6,'A',false); lc2.setChar(0,5,'1',false); lc2.setChar(0,4,'0',false); lc2.setChar(0,2,'c',false); Loads do it on the fly! Royal Bavarian Airforce all the way RIG: RYZEN 7 5800X3D~ ZOTAC 4080 Super ~ AORUS X570S Elite AX ~64 GB Corsair Venegance DDR-4 3600 ~ BeQuiet AIO Silent loop 2 360 watercooled ~ Samsung 890 Pro M.2 (2TB) + 870 EVO (1TB) SSD ~ WIN 10 64-bit ~ AOC 31.5" Gaming 144Hz Display ~ DelanClip@TrackIR 5 ~ TM Warthog no.2 ~Saitek rudder pedals~ 2 TM MFDs on 2nd 27"display ~ Buddyfox A-10 UFC ~ CDU/AAP panel via DCSBios ~ ARC-210 (soldering WIP) ~ QUEST 3
Recommended Posts