Jump to content

Hatiz

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Hatiz

  1. After last update I had problems with caution lights in my cockpit. As I checked in Control Reference their codes has changed E.g: DcsBios::LED lightMainGen(0x4476, 0x0020, 12); (Before) DcsBios::LED lightMainGen(0x447a, 0x0002, 12); (Now) This small diffrences made my lights completly usless. After changes in codes they are working. I saw that my segment display is not working with code that was fine before, so I checed strings, and they are diffrents too. E.g: DcsBios::StringBuffer<7> uhfFreqDispBuffer(0x4590, onUhfFreqDispChange); (Before) DcsBios::StringBuffer<7> uhfFreqDispBuffer(0x45a8, onUhfFreqDispChange); (Now) Anyone of you had same problems as me? Is there are any other thigns I should know?
  2. void onUhfFreqDispChange(char* newValue) { display.setBrightness(2); char str1[3] = {(newValue[0]), (newValue[1]), (newValue[2])}; display.showString(str1,3,0); } DcsBios::StringBuffer<7> uhfFreqDispBuffer(0x45a8, onUhfFreqDispChange); keep scrolling even when char str1[1] = {(newValue[0])}; It's really strange...
  3. Still scrolling, Im losing my mind... Edit: String still must thinking that is to long and that's why is skipping characters. But why if theres is 6 characters? When Im trying display uhf chan which is 2 characters its working perfectly with no problems.
  4. I deleted dot from value and now have 6 characters so it should fit perfectly in display, but it keep scrolling. void onUhfFreqDispChange(char* newValue) { char str[6] = {(newValue[0]), (newValue[1]), (newValue[2]), (newValue[4]), (newValue[5]), (newValue[6])}; display.setBrightness(BRIGHT_HIGH); display.showString(str); } DcsBios::StringBuffer<7> uhfFreqDispBuffer(0x4590, onUhfFreqDispChange); I made that different than you told me, but with the same results (6 characters).
  5. I tried showString and it's making blank display while radio is off, but its showing dot in digit place so value is too long to fit in display and because of that it is scrolling and disappear. void onUhfFreqDispChange(char* newValue) { display.setBrightness(BRIGHT_HIGH); display.showString(newValue); } DcsBios::StringBuffer<7> uhfFreqDispBuffer(0x4590, onUhfFreqDispChange); How to set dot correctly in right place? Or how to remove dot? I know that I can isolate value like newValue[3] (dot), but I don't know what to do with this fact. 20220223_172349_Trim_Trim2.mp4
  6. Yes but e.g if I lose power it still be working and displaying zeros until I turn off radio. it's doesn't depend from dcs bios, but from physical switch. I'm not satisfied with that solution
  7. Hello! As the title says I need help with my segment display. Im making uhf radio panel for my f-16c simpit. I bought that nice display https://pl.aliexpress.com/item/4001293690559.html?gatewayAdapt=glo2pol&spm=a2g0o.order_list.0.0.21ef1c24AJGZ6f After many hours trying to make it work with DCS BIOS, it's actually worked... But there are some issues. When I turn on radio, digits turns on too and I can change them correctly, but when Im turning off radio, all digits are changing to 0 and staying in that position til I turn radio on again. I want to have blank display! My code: /* Mega and Uno pinout is the same * GRND = GRND * VCC = 5V * D10 = Digital input pin - this code uses pin 3 * CLK = Digital input pin - this code uses pin 2 */ #define DCSBIOS_DEFAULT_SERIAL #include <Arduino.h> #include <TM1637TinyDisplay6.h> #define CLK 2 //pins definitions for TM1637 and can be changed to other ports #define DIO 3 TM1637TinyDisplay6 display(CLK, DIO); #include "DcsBios.h" uint8_t data[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; // Test Pattern - All uint8_t blank[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Test Pattern - Blank uint8_t dots = 0b01010000; // Add dots or colons (depends on display module) // DCS-Bios Code void onUhfFreqDispChange(char* newValue) { //newValue[3] - dot display.setBrightness(1); data[0] = display.encodeDigit(newValue[0]); // digit 1 data[1] = display.encodeDigit(newValue[1]); // digit 2 data[2] = display.encodeDigit(newValue[2]); // digit 3 data[3] = display.encodeDigit(newValue[4]); // digit 4 data[4] = display.encodeDigit(newValue[5]); // digit 5 data[5] = display.encodeDigit(newValue[6]); // digit 6 display.setSegments(data); } DcsBios::StringBuffer<7> uhfFreqDispBuffer(0x4590, onUhfFreqDispChange); // End DCS-Bios Code void setup() { DcsBios::setup(); display.clear(); display.setSegments(blank); } void loop() { DcsBios::loop(); } Library that I'm using: https://github.com/jasonacox/TM1637TinyDisplay I was trying many others but that one seems to work the best for me. I'm using arduino mega Thank you in advance for help and sorry for my English!
×
×
  • Create New...