Jump to content

lesthegrngo

Members
  • Posts

    1245
  • Joined

  • Last visited

Everything posted by lesthegrngo

  1. Relax, no hurry! I didn't expect anyone to respond so quickly anyway! Les
  2. In the DCS World\Mods\A-10C\Cockpit\Scripts folder there is a file called 'clickabledata.lua it has the following (on my file line 701 on) --Oxygen System Control Panel --elements["PTR-OXYGENCP-EMERGENCY"] = default_3_position_tumb(_("Oxygen Flow Emergency/Normal/Test Mask"), devices.OXYGEN_SYSTEM, device_commands.Button_3, 601) -- TEST MASK position is spring-loaded elements["PTR-OXYGENCP-EMERGENCY"] = {class = {class_type.TUMB, class_type.BTN}, hint = _("Oxygen Flow Emergency/Normal/Test Mask"), device = devices.OXYGEN_SYSTEM, action = {device_commands.Button_3, device_commands.Button_3}, stop_action = {0, device_commands.Button_3}, arg = {601, 601}, stop_value = {nil, 0.0}, arg_value = {1, -1}, arg_lim = {{0, 1},{-1, 0}}, use_release_message = {false, true}, updatable = true, use_OBB = true} It says that the test mask position is spring loaded, could it be that in my iteration it is set so that it can't be selected by an outside device? In game I can click to select it, but it will spring back immediately it is released Les
  3. Yeah, tried it with the same result I wonder whether the .lua file has been changed somehow, I'll see if there is something in there Les
  4. I've got something weird happening then, because even if I use a new nano with a flylead from the GND pin and set your code above using pins 8, 9 and 10, Emergency and Normal positions are fine, but I can't get it to select the Test position If it is a coding issue, it's got to be in the game code somewhere... Les
  5. Hi all, curiously my Oxy panel can't select the 'test' position I have the following code in the sketch const byte oxyEmergencyPins[3] = {17, 16, 15}; DcsBios::SwitchMultiPos oxyEmergency("OXY_EMERGENCY", oxyEmergencyPins, 3); The Emergency and Normal positions are fine, but the test position is ignored Is that consistent with your experience? I'm sure it used to work..... Les
  6. Thanks I tried the SSD1306 sketch, didn't want to work at all - the OLED I have really seems fussy, in fact I don't recall any others using SSD1305 However I tried blanking out using filled rectangles, and after a few attempts got it working correctly with the sketch below #define DCSBIOS_IRQ_SERIAL #include <DcsBios.h> #include <Wire.h> #include <SPI.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1305.h> #include "Fonts/FreeSans18pt7b.h" // Used for software SPI #define OLED_CLK 13 #define OLED_MOSI 11 // Used for software or hardware SPI #define OLED_CS 8 #define OLED_DC 9 // Used for I2C or SPI #define OLED_RESET 10 // software SPI //Adafruit_SSD1305 display(128, 32, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); // hardware SPI - use 7Mhz (7000000UL) or lower because the screen is rated for 4MHz, or it will remain blank! Adafruit_SSD1305 display(128, 32, &SPI, OLED_DC, OLED_RESET, OLED_CS, 6000000UL); // I2C //Adafruit_SSD1305 display(128, 64, &Wire, OLED_RESET); void setup() { { display.begin(0x3C); //display.display(); // show splashscreen delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans18pt7b); } DcsBios::setup(); } DcsBios::RotaryEncoder ilsVol("ILS_VOL", "-3200", "+3200", 16, 17); DcsBios::RotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", 18, 19); DcsBios::RotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", 15, 14); void loop() { DcsBios::loop(); display.display(); display.setTextColor(WHITE, BLACK); display.setCursor(66, 27); display.print("."); display.display(); } void onIlsMhzChange(char* newValue) { display.fillRect(0, 0, 65, 32, BLACK); display.setTextColor(WHITE, BLACK); display.setCursor(8, 27); display.print(newValue); display.display(); } void onIlsKhzChange(char* newValue) { display.fillRect(75, 0, 50, 32, BLACK); display.setTextColor(WHITE, BLACK); display.setCursor(75, 27); display.print(newValue); display.display(); } DcsBios::StringBuffer<2> ilsKhzStrBuffer(0x1172, onIlsKhzChange); DcsBios::StringBuffer<3> ilsMhzStrBuffer(0x116e, onIlsMhzChange); Cheers for all the input guys! Another one working Les
  7. I tried just calling out the font at the beginning of the sketch, it works the same - if nothing else it will simplify the sketch though. I'll have to look into the values in black, but I suspect I am missing something really simple Cheers Les
  8. Thanks Vinc I tried both, but the same behaviour. Cheers Les
  9. Got it back now, the instructions said to redownload it, as the authorisation was still active. Happy to say that it worked, so all good now Cheers for the assistance guys Les
  10. I've got my ILS panel working with this OLED, however with a bug; it will correctly display the MHz and KHz values, but when you then use the rotary encoders to change the values, instead of clearing the previous value and displaying the new one, it adds the new value to the old one. I tried using the clearDisplay function, but all that ends up doing is clearing the display completely, then displaying just the KHz value; when either the MHz or the KHz RE's are moved, it will display just the new value, and then after a second just display the KHz value. Clearly my use of the clearDisplay is not right . The sketch is included below with the clearDisplay instances commented out. I tried both in the setup and loop areas and it seems to be the same #define DCSBIOS_IRQ_SERIAL #include <DcsBios.h> #include <Wire.h> #include <SPI.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1305.h> #include "Fonts/FreeSans18pt7b.h" // Used for software SPI #define OLED_CLK 13 #define OLED_MOSI 11 // Used for software or hardware SPI #define OLED_CS 8 #define OLED_DC 9 // Used for I2C or SPI #define OLED_RESET 10 // software SPI //Adafruit_SSD1305 display(128, 32, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); // hardware SPI - use 7Mhz (7000000UL) or lower because the screen is rated for 4MHz, or it will remain blank! Adafruit_SSD1305 display(128, 32, &SPI, OLED_DC, OLED_RESET, OLED_CS, 6000000UL); // I2C //Adafruit_SSD1305 display(128, 64, &Wire, OLED_RESET); void setup() { { display.begin(0x3C); delay(1000); display.clearDisplay(); // clears the screen and buffer } DcsBios::setup(); } DcsBios::RotaryEncoder ilsVol("ILS_VOL", "-3200", "+3200", 16, 17); DcsBios::RotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", 18, 19); DcsBios::RotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", 15, 14); void loop() { DcsBios::loop(); //display.clearDisplay(); display.setFont(&FreeSans18pt7b); display.setTextColor(WHITE); display.setCursor(66, 27); display.println("."); display.display(); } void onIlsMhzChange(char* newValue) { display.setFont(&FreeSans18pt7b); //display.clearDisplay(); display.setTextColor(WHITE); display.setCursor(8, 27); display.println(newValue); display.display(); } DcsBios::StringBuffer<3> ilsMhzStrBuffer(0x116e, onIlsMhzChange); void onIlsKhzChange(char* newValue) { display.setFont(&FreeSans18pt7b); //display.clearDisplay(); display.setTextColor(WHITE); display.setCursor(75, 27); display.println(newValue); display.display(); } DcsBios::StringBuffer<2> ilsKhzStrBuffer(0x1172, onIlsKhzChange); Can anyone advise how I can correctly clean the screen without the text disappearing? Les
  11. Frustratingly the response to the ticket was to essentially ask me to repeat what I already did from the suggestions above, neatly ignoring the fact that the ticket was titled 'Reactivating DLC bought as a DVD' I even quoted a link to this thread hoping they would look and see what had been done. I've replied stressing the need for the reactivation, but I am not optimistic Les
  12. Yep, that did it after I put // in front of the word 'needed' - works great! it's a good way to test still ruminating on how to limit the wheel movement, although maybe I'm overthinking it Les
  13. Yeah, saw it and tried it, but gave errors - as I am a) pretty hung over and b) also trying to watch the cricket I found myself not trying too hard to fix it! Cheers Les
  14. Thanks - I sent them a ticket, let's see what they say Les
  15. Unfortunately it came up with a message saying that the A10C pack is not authorised and so will be disabled. Looks like I need to seek support Les
  16. Thanks, just trying the repair using the slow 'check all files' function, will report back once done Les
  17. Ok, thanks - the nuclear option! Cheers Les
  18. here you go the second line reports 2023-06-17 10:58:17.762 INFO DCS: DCS/2.5.6.49798 (x86_64; Windows NT 10.0.19045) dcs redo.log
  19. Thanks, I'll give that a go In the meantime, someone sent me this // TEST For "Profile switch" currently set to read BCD switch // once during setup; move code as noted below for repeated reads // BCD Switch inputs attached to pins D4-7, common to Ground // (use internal pullups) // Define data bit pins int profile_BIT1 = 4; int profile_BIT2 = 5; int profile_BIT4 = 6; int profile_BIT8 = 7; // Define profile variable, set to 0 int profile = 0; void setup() { // initialize serial communication at 9600 bits per second (only needed // for debugging: Serial.begin(9600); // make the profile switch's pins inputs, with internal pullups on: pinMode(profile_BIT1, INPUT_PULLUP); pinMode(profile_BIT2, INPUT_PULLUP); pinMode(profile_BIT4, INPUT_PULLUP); pinMode(profile_BIT8, INPUT_PULLUP); // to make read on each pass move all below this to "loop", // uncomment profile reset // read the input pins: NOTE - CLOSED switch (binary 1) returns "0" int val_profile_BIT1 = digitalRead(profile_BIT1); int val_profile_BIT2 = digitalRead(profile_BIT2); int val_profile_BIT4 = digitalRead(profile_BIT4); int val_profile_BIT8 = digitalRead(profile_BIT8); //int profile = 0; needed in loop to reset to 0 for each pass // turn bit values into single profile value by adding decimal value // of each bit to profile variable if ( val_profile_BIT1 == 0) { profile = profile + 1; } if ( val_profile_BIT2 == 0) { profile = profile + 2; } if ( val_profile_BIT4 == 0) { profile = profile + 4; } if ( val_profile_BIT8 == 0) { profile = profile + 8; } // DEBUG - prints out the state of the switch bits and profile value {Serial.print("[profile_BIT1: "); Serial.print(val_profile_BIT1); Serial.print("] "); Serial.print("[profile_BIT2: "); Serial.print(val_profile_BIT2); Serial.print("] "); Serial.print("[profile_BIT4: "); Serial.print(val_profile_BIT4); Serial.print("] "); Serial.print("[profile_BIT8: "); Serial.print(val_profile_BIT8); Serial.print("] "); Serial.print("[profile: "); Serial.print(profile); Serial.println("] ");} } // delay in between reads for stability, uncomment if in loop // delay(1000); void loop() { } You have to reset the Nano after every move of the thumbwheel switch so that it shows on the serial monitor but it does work For info I tried it with the '8' connection disconnected and predictably position 9 reports as 1 and position 8 reports as 0. I know that the in-game numbers don't go past 7 but I am unsure how to stop the thumbwheels from physically moving to those positions and was hoping to use three connections rather than four to help with that. However it looks like I will have to find another way Les
  20. Getting the IFF BCD thumbwheels working on my IFF panel was on my 'to do' list, so this morning after seeing this I started as I always do with a simple test to understand the components a bit better. In pursuit of that I soldered on the connections to one of the Hampolt BCS thumbwheels, and downloaded and installed the sketch from here https://www.instructables.com/Arduino-and-Thumbwheel-Switches/ to check it out. I soldered in some 10K resistors on a patch board and wired up accordingly Trouble is, it doesn't work! The serial monitor displays '15' when the thumbwheel is at zero, and '0' for any other value So, I have searched for an alternative test sketch that maybe uses an alternative schematic, but can't find one. If someone does have a simple test sketch I would like to know about it Les
  21. Here are the two .log files, interestingly the one from the DCS Warthog folder is from november 2022... dcs warthog.log dcs.log
  22. I have the following folders DCS DCS Warthog Cheers Les
  23. This shows my age, I bought the DVD when DCS first came out! Les
  24. Thanks - I am not sure how it happened. What about the DVD activation, isn't there a limit to the number of times? I'm worried if I delete everything it won't be able to be reactivated Cheers Les
  25. Are there any workable alternatives to the PWM method? Not sure I like the idea of the whining sound Cheers Les
×
×
  • Create New...