Jump to content

SrSosio

Members
  • Posts

    257
  • Joined

  • Last visited

3 Followers

About SrSosio

  • Birthday 03/05/1981

Personal Information

  • Flight Simulators
    DCS
  • Location
    Barcelona
  • Interests
    DIY, 3D printing, simulation

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @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); }
  2. 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!!
  3. Thank you. I'll see if I can test that later on and I'll let you know how it goes, but looks promising.
  4. 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.
  5. 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.
  6. 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);
  7. Works like a charm, thank you!
  8. Thank you!! I'm goint to try that right away!
  9. What screens do you use?
  10. 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);
  11. 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.
  12. 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.
  13. 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.
  14. Does it not compensate for wind? It happens almost in front of me.
  15. 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.
×
×
  • Create New...