Jump to content

SrSosio

Members
  • Posts

    283
  • Joined

  • Last visited

Everything posted by SrSosio

  1. hey, no, that was just a test to see if I could read the position of the cursor. The switch does work by: void onCpgKuDisplayChange(char* newValue) { if (status == 0) updateDisplay(newValue); } DcsBios::StringBuffer<22> cpgKuDisplayBuffer(0x80ac, onCpgKuDisplayChange); void onPltKuDisplayChange(char* newValue) { if (status == 1) updateDisplay(newValue); } DcsBios::StringBuffer<22> pltKuDisplayBuffer(0x808e, onPltKuDisplayChange); That only executes the updateDisplay function for the pilot or the CPG if the switch is in the 1 or the 0 position. So if it isn't, it won't display anything. No, each crew member has total control and independence over their KU, including the display. They could be typing in different things at the same time.
  2. @Vinc_Vega since I already have you engaged in the conversation, please find below the code I'm using. Ignore the display part for now, I haven't had time to work on it yet, but as you can see I added a bool variant, attached to a 2 position switch. It's intended to switch between PLT and CPG seats, and it works as expected for the display part. However, I've also duplicated the inputs, to be able to use the KU in both seats, which also works, but also has a side effect, and that is that whatever you type, it's displayed in both units, even when a human player is in the other seat. Can you think of a way to also apply the bool variant to the inputs so only one of them is used at a time? Thank you #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <LiquidCrystal_I2C.h> bool status = 1; LiquidCrystal_I2C lcd(0x27, 8, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display DcsBios::Switch2Pos cpgKu0("CPG_KU_0", 24); DcsBios::Switch2Pos cpgKu1("CPG_KU_1", 34); DcsBios::Switch2Pos cpgKu2("CPG_KU_2", 35); DcsBios::Switch2Pos cpgKu3("CPG_KU_3", 36); DcsBios::Switch2Pos cpgKu4("CPG_KU_4", 43); DcsBios::Switch2Pos cpgKu5("CPG_KU_5", 44); DcsBios::Switch2Pos cpgKu6("CPG_KU_6", 45); DcsBios::Switch2Pos cpgKu7("CPG_KU_7", 52); DcsBios::Switch2Pos cpgKu8("CPG_KU_8", 53); DcsBios::Switch2Pos cpgKu9("CPG_KU_9", 31); DcsBios::Switch2Pos cpgKuA("CPG_KU_A", 14); DcsBios::Switch2Pos cpgKuB("CPG_KU_B", 13); DcsBios::Switch2Pos cpgKuC("CPG_KU_C", 12); DcsBios::Switch2Pos cpgKuD("CPG_KU_D", 11); DcsBios::Switch2Pos cpgKuE("CPG_KU_E", 32); DcsBios::Switch2Pos cpgKuF("CPG_KU_F", 33); DcsBios::Switch2Pos cpgKuG("CPG_KU_G", 37); DcsBios::Switch2Pos cpgKuH("CPG_KU_H", 38); DcsBios::Switch2Pos cpgKuI("CPG_KU_I", 39); DcsBios::Switch2Pos cpgKuJ("CPG_KU_J", 40); DcsBios::Switch2Pos cpgKuK("CPG_KU_K", 41); DcsBios::Switch2Pos cpgKuL("CPG_KU_L", 42); DcsBios::Switch2Pos cpgKuM("CPG_KU_M", 46); DcsBios::Switch2Pos cpgKuN("CPG_KU_N", 47); DcsBios::Switch2Pos cpgKuO("CPG_KU_O", 48); DcsBios::Switch2Pos cpgKuP("CPG_KU_P", 49); DcsBios::Switch2Pos cpgKuQ("CPG_KU_Q", 50); DcsBios::Switch2Pos cpgKuR("CPG_KU_R", 51); DcsBios::Switch2Pos cpgKuS("CPG_KU_S", 30); DcsBios::Switch2Pos cpgKuT("CPG_KU_T", 29); DcsBios::Switch2Pos cpgKuU("CPG_KU_U", 28); DcsBios::Switch2Pos cpgKuV("CPG_KU_V", 27); DcsBios::Switch2Pos cpgKuW("CPG_KU_W", 26); DcsBios::Switch2Pos cpgKuX("CPG_KU_X", 25); DcsBios::Switch2Pos cpgKuY("CPG_KU_Y", 10); DcsBios::Switch2Pos cpgKuZ("CPG_KU_Z", 9); DcsBios::Switch2Pos cpgKuLeft("CPG_KU_LEFT", 18); DcsBios::Switch2Pos cpgKuRight("CPG_KU_RIGHT", 17); DcsBios::Switch2Pos cpgKuBks("CPG_KU_BKS", 7); DcsBios::Switch2Pos cpgKuClr("CPG_KU_CLR", 19); DcsBios::Switch2Pos cpgKuDiv("CPG_KU_DIV", 4); DcsBios::Switch2Pos cpgKuDot("CPG_KU_DOT", 23); DcsBios::Switch2Pos cpgKuEnt("CPG_KU_ENT", 16); DcsBios::Switch2Pos cpgKuMinus("CPG_KU_MINUS", 2); DcsBios::Switch2Pos cpgKuMulti("CPG_KU_MULTI", 5); DcsBios::Switch2Pos cpgKuPlus("CPG_KU_PLUS", 3); DcsBios::Switch2Pos cpgKuSign("CPG_KU_SIGN", 22); DcsBios::Switch2Pos cpgKuSlash("CPG_KU_SLASH", 8); DcsBios::Switch2Pos cpgKuSpc("CPG_KU_SPC", 6); DcsBios::Potentiometer cpgKuBrt("CPG_KU_BRT", A0); DcsBios::Switch2Pos pltKu0("PLT_KU_0", 24); DcsBios::Switch2Pos pltKu1("PLT_KU_1", 34); DcsBios::Switch2Pos pltKu2("PLT_KU_2", 35); DcsBios::Switch2Pos pltKu3("PLT_KU_3", 36); DcsBios::Switch2Pos pltKu4("PLT_KU_4", 43); DcsBios::Switch2Pos pltKu5("PLT_KU_5", 44); DcsBios::Switch2Pos pltKu6("PLT_KU_6", 45); DcsBios::Switch2Pos pltKu7("PLT_KU_7", 52); DcsBios::Switch2Pos pltKu8("PLT_KU_8", 53); DcsBios::Switch2Pos pltKu9("PLT_KU_9", 31); DcsBios::Switch2Pos pltKuA("PLT_KU_A", 14); DcsBios::Switch2Pos pltKuB("PLT_KU_B", 13); DcsBios::Switch2Pos pltKuC("PLT_KU_C", 12); DcsBios::Switch2Pos pltKuD("PLT_KU_D", 11); DcsBios::Switch2Pos pltKuE("PLT_KU_E", 32); DcsBios::Switch2Pos pltKuF("PLT_KU_F", 33); DcsBios::Switch2Pos pltKuG("PLT_KU_G", 37); DcsBios::Switch2Pos pltKuH("PLT_KU_H", 38); DcsBios::Switch2Pos pltKuI("PLT_KU_I", 39); DcsBios::Switch2Pos pltKuJ("PLT_KU_J", 40); DcsBios::Switch2Pos pltKuK("PLT_KU_K", 41); DcsBios::Switch2Pos pltKuL("PLT_KU_L", 42); DcsBios::Switch2Pos pltKuM("PLT_KU_M", 46); DcsBios::Switch2Pos pltKuN("PLT_KU_N", 47); DcsBios::Switch2Pos pltKuO("PLT_KU_O", 48); DcsBios::Switch2Pos pltKuP("PLT_KU_P", 49); DcsBios::Switch2Pos pltKuQ("PLT_KU_Q", 50); DcsBios::Switch2Pos pltKuR("PLT_KU_R", 51); DcsBios::Switch2Pos pltKuS("PLT_KU_S", 30); DcsBios::Switch2Pos pltKuT("PLT_KU_T", 29); DcsBios::Switch2Pos pltKuU("PLT_KU_U", 28); DcsBios::Switch2Pos pltKuV("PLT_KU_V", 27); DcsBios::Switch2Pos pltKuW("PLT_KU_W", 26); DcsBios::Switch2Pos pltKuX("PLT_KU_X", 25); DcsBios::Switch2Pos pltKuY("PLT_KU_Y", 10); DcsBios::Switch2Pos pltKuZ("PLT_KU_Z", 9); DcsBios::Switch2Pos pltKuLeft("PLT_KU_LEFT", 18); DcsBios::Switch2Pos pltKuRight("PLT_KU_RIGHT", 17); DcsBios::Switch2Pos pltKuBks("PLT_KU_BKS", 7); DcsBios::Switch2Pos pltKuClr("PLT_KU_CLR", 19); DcsBios::Switch2Pos pltKuDiv("PLT_KU_DIV", 4); DcsBios::Switch2Pos pltKuDot("PLT_KU_DOT", 23); DcsBios::Switch2Pos pltKuEnt("PLT_KU_ENT", 16); DcsBios::Switch2Pos pltKuMinus("PLT_KU_MINUS", 2); DcsBios::Switch2Pos pltKuMulti("PLT_KU_MULTI", 5); DcsBios::Switch2Pos pltKuPlus("PLT_KU_PLUS", 3); DcsBios::Switch2Pos pltKuSign("PLT_KU_SIGN", 22); DcsBios::Switch2Pos pltKuSlash("PLT_KU_SLASH", 8); DcsBios::Switch2Pos pltKuSpc("PLT_KU_SPC", 6); DcsBios::LED pltApuBtn1(0x8700, 0x1000, A1); DcsBios::LED pltApuBtn2(0x8700, 0x1000, A2); DcsBios::Potentiometer pltKuBrt("PLT_KU_BRT", A0); //void updateDisplay(char* newValue){ // lcd.setCursor(0,0); // lcd.print(newValue); // // lcd.setCursor(0,1); // lcd.print(newValue[8]); // lcd.print(newValue[9]); // lcd.print(newValue[10]); // lcd.print(newValue[11]); // lcd.print(newValue[12]); // lcd.print(newValue[13]); // lcd.print(newValue[14]); // lcd.print(newValue[15]); // lcd.print(newValue[16]); // lcd.print(newValue[17]); // lcd.print(newValue[18]); // lcd.print(newValue[19]); // lcd.print(newValue[20]); // lcd.print(newValue[21]); // //} void updateDisplay(char* newValue){ lcd.setCursor(0,0); if (newValue[0] == char(35)) lcd.print("yes"); } void onCpgKuDisplayChange(char* newValue) { if (status == 0) updateDisplay(newValue); } DcsBios::StringBuffer<22> cpgKuDisplayBuffer(0x80ac, onCpgKuDisplayChange); void onPltKuDisplayChange(char* newValue) { if (status == 1) updateDisplay(newValue); } DcsBios::StringBuffer<22> pltKuDisplayBuffer(0x808e, onPltKuDisplayChange); void setup() { DcsBios::setup(); lcd.init(); lcd.backlight(); lcd.clear(); lcd.print("AH-64 KU"); lcd.setCursor(0,1); lcd.print(" for DCS"); pinMode(A1, OUTPUT); pinMode(A2, OUTPUT); pinMode(A3, INPUT_PULLUP); } void loop() { DcsBios::loop(); if (digitalRead(A3) != status) status = digitalRead(A3); }
  3. The first one actually worked!! so now I have to think of how I do the code, but I think this will allow me to do think of something. Thank you very much!!
  4. Thank you. I'll see if I can test that later on and I'll let you know how it goes, but looks promising.
  5. Yes, it reads the cursor as #, but I haven't been able to use an if statement, something like if (newValue[0] == "#") which would indicate that the cursor is in the first position.
  6. Hey, thank you for your reply. Unfortunately, although my LCD is physically a 1601, it behaves as a 0802, hence why I need the setCursor part. I think the best approach would actually be to display the characters based on where the cursor is. There's always a cursor, as it's a keyboard unit, and my gut feeling tells me that I should be displaying the 16 characters prior to the cursor, so if the cursor is at position 4, for example, I display the first 16 characters, but if it's at position 22, then I display the last 16 (from 7 to 22). The problem is that I'm unable to read the position of the cursor. I've posted the same question in the DCS-BIOS github discussion section. Hopefully some of the developers will be able to help me with that.
  7. Hello good fellas. I hereby present you a dilema. I'm building an Apache KU with a 1601A LCD. Yes, I know, it's not the best option for an LCD and I'm actually looking for other alternatives. I found a 2402 that looks promising, but in the meantime I do need to work with this, as I'm building it for someone else and I need to use this LCD. The thing is that I managed it to work, but obviously only displays 16 characters, so if you start typing, you will miss the last 6 characters when you get to that point. My original idea was to only display the last 16 characters of the display (provided there's more than 16 chars being displayed, but that poses another issue. If you have more than 16 chars used, you will never be able to go back and see the first 6 chars unless you actually go back by deleting the characters instead of just using the left arrow. So I guess the solution would be to identify where the cursor is and have it always on screen, somehow. Any idea on how can I do that? My current, rudimentary code, that uses the outdated LiquidCrystal_I2C library because I couldn't figure out how to use the hd44780 one, and only displays the first 16 chars looks like this: void onCpgKuDisplayChange(char* newValue) { lcd.clear(); lcd.setCursor(0,0); lcd.print(newValue[0]); lcd.print(newValue[1]); lcd.print(newValue[2]); lcd.print(newValue[3]); lcd.print(newValue[4]); lcd.print(newValue[5]); lcd.print(newValue[6]); lcd.print(newValue[7]); lcd.setCursor(0,1); lcd.print(newValue[8]); lcd.print(newValue[9]); lcd.print(newValue[10]); lcd.print(newValue[11]); lcd.print(newValue[12]); lcd.print(newValue[13]); lcd.print(newValue[14]); lcd.print(newValue[15]); } DcsBios::StringBuffer<22> cpgKuDisplayBuffer(0x80ac, onCpgKuDisplayChange);
  8. Works like a charm, thank you!
  9. Thank you!! I'm goint to try that right away!
  10. What screens do you use?
  11. Hey, I'm building one myself, and having trouble with exporting the display. I checked your code in github and saw this: DcsBios::StringBuffer<22> pltKuDisplayBuffer(0x808e, onPltKuDisplayChange); What's 0x808e? In my code I have: DcsBios::StringBuffer<22> pltKuDisplayBuffer(AH_64D_PLT_KU_DISPLAY_A, onPltKuDisplayChange);
  12. 80 bucks not including the screens right? I built MPDS myself, but I'm using 10.4" screens, and only those are 80-100 a piece.
  13. hey! quick question. Seeing the latest pictures, looks like the screen is not black background, is that correct? I'm having troubles finding these LCD in green/black combination. I don't even know if they exist.
  14. At around 3000 feet max. I know it's an area weapon, but when you shoot a round of 10 bullets, you want them all to fall in the general area you are looking at. With this bug, I get them all of them offset. If it keeps happening, I'll record it so you can see it better.
  15. Does it not compensate for wind? It happens almost in front of me.
  16. Hi. I have an issue sometimes that when aiming and lasing something with the TEDAC, the bullets seem to be off to one side, making it very complicated to aim since you have to eyeball it and it's a very inaccurate way to do it. Granted I do not boresight the ihads in the front seat, but it shouldn't be needed. And I also take off before waiting the INS, but I don't think that's the cause either, because it seems to happen after some successful shots, it doesn't happen from the beginning. Anyone else has experienced this? is this a known bug? Next time I'll try waiting for the alignment, see if that makes any difference.
  17. Yes, that comment relates to the first post: In previous versions, you had to overwrite some game files with the ones attached, but it seems like since the last patch, is no longer needed.
  18. I don't use Helios. I find it easier to just modify the lua file.
  19. Correct me if I'm wrong, but looks like since yesterday's patch, it's no longer needed to replace the mod files
  20. Ok, looks like I managed to fix it. There were some files that I had previously to replace in order for the MPCDs to switch between seats: Looks like this is no longer needed. After yesterday's patch, I had replaced those files, and that's when the TEDAC stopped working. I've run a full repair, and without replacing those files, it now seems to work, and the MPCDs switch properly between seats.
  21. Anyone? I did another test. I switched the right mfd and the tedac, to see if it had something to do with my screen, but no, when I did that, the right mfd properly displayed in screen 5, and nothing displayed in screen 4 (right mfd), so it has to be something with the export. I also tried both TEDAC and CENTER_MPCD. I also tried jumping in an MP server and getting in an occupied aircraft directly as CPG (so no switching seats), and it's the same.
  22. The first one is sold. The one in the pictures is for sale now.
  23. Hey, is it just me or the TEDAC viewport no longer works after yesterday's patch? This is my monitor config file: _ = function(p) return p end name = _('Apache') description = 'PLT and CPG exports' LEFT_MFCD = { x = 24, y = 2160, width = 1280, height = 960 } RIGHT_MFCD = { x = 1318, y = 2160, width = 1280, height = 960 } TEDAC = { x = 2786, y = 2160, width = 768, height = 768 } Viewports = { Center = { x = 0, y = 0, width = 4096, height = 2160, aspect = 1.896296296296296, dx = 0, dy = 0 } } UIMainView = Viewports.Center GU_MAIN_VIEWPORT = Viewports.Center My MFCDs do work normally. And this is my monitor setup:
  24. Oh! Thank you! I guess you can then close the ticket I just opened. I really appreciate the understanding and the prompt response. You're the best
  25. Thank you both, I will
×
×
  • Create New...