WhoMadeWho Posted February 8, 2018 Posted February 8, 2018 Hello all, I'm trying to get the HSI Range to display correctly via DCS-BIOS outputting to a simple OLED display. The problem is DCS-BIOS is ranging the output from 0 to 65535. According to the DCS A10C manual, this gauge can display 0 to 9999. So... If I take the output value and divide by 6.5 I get an accurate count... For example, 8 miles will read 7,991.5384. BUT I want my display to show 008. Is there a solution to this? Does some rounding need to be done? I feel like I'm missing something very obvious here. :doh: The DCS-BIOS code snip in question is - void onHsiRcDChange(unsigned int newValue) { display.clearDisplay(); display.setFont(&digital_counter_717pt7b); display.setTextColor(WHITE); display.setCursor(0,28); [color="Red"]display.print(newValue / 6.5);[/color] display.display(); } DcsBios::IntegerBuffer hsiRcDBuffer(0x1060, 0xffff, 0, onHsiRcDChange);
Hansolo Posted February 9, 2018 Posted February 9, 2018 Hi WhoMadeWho, Sorry can't really help you with rounding up/down of the number. BUT do you really want to do this?? My reason for asking is that when you fly a DME arc of 8, you would like to know if you are going away from or closer to before the switch to either 9 or 7. Ian, and others I presume, made some altimeters using OLED and there you get the same display as you do on the altimeter which I think may be hacked into showing the HSI range in a similar fasion; Just a kind suggestion Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
WhoMadeWho Posted February 9, 2018 Author Posted February 9, 2018 Thanks Hans. I'll have a look at his code. I do recall this video - now that you posted it. :)
Recommended Posts