Jump to content

Recommended Posts

Posted

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);

 

Posted

@SrSosio

I don't have that 1601A LCD but used other displays already in a similar way.

Furthermore, I don't have the AH-64 module, so I can't verify my suggestions.

 

But, the exported string may hold up to 22 characters, that's what the StringBuffer declaration for DCS Bios says.

I think that you don't need the code to set the cursor in the second line (0, 1), because it's a single line LCD that holds maximal 16 characters (that is what 1601 stands for).

The setCursor command brings you e.g from the first digit (0, 0) up to the 16th digit (15, 0), where 0 after the colon stands for the first line (and 1 would be the second line).

So at first glance you are limited to print either the first or the last 16 chars (bytes).

I don't know how important the last characters are and if all bytes are used in every messages.

It may help if you'd provide some examples on the content of the line to be printed.

 

To display more than the 16 characters you may produce some kind of scrolling effect, that unfortunately is not supported by the library.

If you were familiar with Arduino coding, you may write a function that reads all the 22 characters from the string and that prints characters 1 to 16, clears the display and prints 2 to 17, clears the display and prints 3 to 18, and so on. Depending on your microcontroller that may waste a lot of calculation power.

Or you read the string and print the first 16 chars, wait a a few seconds (do not use delay() !) and than print over the last 16 chars. So you automatically switch between the begin and the end of that string.

You also may use a function that reads all characters and looks for spaces or so and than prints the line only until that byte.

 

 

Regards, Vinc

 

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

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.

Posted

@SrSosio

Can you read out some lines, e.g. by using the Bort software and copy the line content?

We than my see if there are some unusual characters like a cursor or so.

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

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.

Posted

@SrSosio

As characters are represented as signed bytes and for the hash tag the ASCII sign is 35, something like that may work for you

if (newValue[0] == char(35)) 


Regards, Vinc

  • Thanks 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
Just now, Vinc_Vega said:

@SrSosio

As characters are represented as signed bytes and for the hash tag the ASCII sign is 35, something like that may work for you

if (newValue[0] == char(35)) 


Regards, Vinc

Thank you. I'll see if I can test that later on and I'll let you know how it goes, but looks promising. 

Posted
2 minutes ago, Vinc_Vega said:

You may also try the plain ASCII code without the char() statement.

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!!

  • Like 1
Posted

@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);
}

 

Posted (edited)

@SrSosio

Independent of the switch position, you will see no difference on the display.

This code always prints an "yes" into the display if the first char of the string is a hash tag.

void updateDisplay(char* newValue){
  lcd.setCursor(0,0);
  if (newValue[0] == char(35)) lcd.print("yes");
}

What if you dispose the "updateDisplay" function and put the code directly within the respective onDisplayChange parts?

void onCpgKuDisplayChange(char* newValue) {
  if (status == 0) {
	  if (newValue[0] == char(35)) {
          lcd.setCursor(0,0);
          lcd.print("Cpg");
          }
	}
}
DcsBios::StringBuffer<22> cpgKuDisplayBuffer(0x80ac, onCpgKuDisplayChange);

void onPltKuDisplayChange(char* newValue) {
  if (status == 1) {
	  if (newValue[0] == char(35)) {
          lcd.setCursor(0,0);
          lcd.print("Plt");
          }
	}
}
DcsBios::StringBuffer<22> pltKuDisplayBuffer(0x808e, onPltKuDisplayChange);

 

Regards, Vinc

 

Edit: How is it in the Simulator Cockpit?

Doesn't the display ever show the same line, no matter which KU is in use? It may be intentionally, that e.g. the commander can see the pilot's input.

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted (edited)
22 minutes ago, Vinc_Vega said:

@SrSosio

Independent of the switch position, you will see no difference on the display.

This code always prints an "yes" into the display if the first char of the string is a hash tag.

void updateDisplay(char* newValue){
  lcd.setCursor(0,0);
  if (newValue[0] == char(35)) lcd.print("yes");
}

What if you dispose the "updateDisplay" function and put the code directly within the respective onDisplayChange parts?

void onCpgKuDisplayChange(char* newValue) {
  if (status == 0) {
	  lcd.setCursor(0,0);
	  if (newValue[0] == char(35)) {
		  lcd.print("Cpg");
		  }
	}
}
DcsBios::StringBuffer<22> cpgKuDisplayBuffer(0x80ac, onCpgKuDisplayChange);

void onPltKuDisplayChange(char* newValue) {
  if (status == 1) {
	  lcd.setCursor(0,0);
	  if (newValue[0] == char(35)) {
		  lcd.print("Plt");
		  }
	}
}
DcsBios::StringBuffer<22> pltKuDisplayBuffer(0x808e, onPltKuDisplayChange);

 

Regards, Vinc

 

Edit: How is it in the Simulator Cockpit?

Doesn't the display ever show the same line, no matter which KU is in use? It may be intentionally, that e.g. the commander can see the pilot's input.

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.

Quote

Doesn't the display ever show the same line, no matter which KU is in use? It may be intentionally, that e.g. the commander can see the pilot's input.

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.

Edited by SrSosio
Posted (edited)

@SrSosio

Okay, you may just declare two new variables within the header of your sketch

String(CpgKuDisplay); String(PltKuDisplay);

 

Then put the content of the DCS Bios strings into these variables and call the display to be updated

void onCpgKuDisplayChange(char* newValue) {
  CpgKuDisplay = newValue;
  updateDisplay();
}
DcsBios::StringBuffer<22> cpgKuDisplayBuffer(0x80ac, onCpgKuDisplayChange);

void onPltKuDisplayChange(char* newValue) {
  PltKuDisplay = newValue;
  updateDisplay();
}
DcsBios::StringBuffer<22> pltKuDisplayBuffer(0x808e, onPltKuDisplayChange);

 

And lastly, use that function and dependent on the switch position print the variables to the LCD

(function just simplified)

void updateDisplay() {
  lcd.setCursor(0,0);
  if (status == 0) {
      	lcd.print(CpgKuDisplay);
    	}
  if (status == 1) {
      	lcd.print(PltKuDisplay);
    	}
}

That should print only one string to the display, even if both variables (strings) are updated.

Regards, Vinc

 

PS: you also may trim that strings (variables) and cut e.g. the first 8 chars before printing to the LCD.

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

But this part is already working, I don't see why would I need to change it. What I wanted to know is if I can limit the inputs with that switch as well. Right now, this is what DCS-BIOS reads when I press a button (which makes sense, as this is how I programmed it), but I'd like to be able to do either PLT or CPG, depending on the position of the switch:

image.png

Not sure if that's even possible at all.

Posted (edited)

I can see your switch working.

The possibility to input different content is by using the global variable (status 0/1) within each of the input (key) functions.

You therefore cannot use the short DCS Bios statements.

 

Edit:

Read the button and than use functions for every key like

DcsBios::tryToSendDcsBiosMessage("CPG_KU_2", "1");

 

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
1 hour ago, Vinc_Vega said:

Read the button and than use functions for every key like

DcsBios::tryToSendDcsBiosMessage("CPG_KU_2", "1");

 

Regards, Vinc

I'm not sure I understand that part. what exactly is tryToSendDCSBiosMessage? isn't that a function? and if it doesn't exist, won't it fail? what are the arguments?

Posted (edited)

@SrSosio

Sorry, that I misinterpreted the above postings as an output problem (I'm not a native English speaker). I now understand that you have duplicated your inputs. That's because you use the same keypress (e.g. pin 35) for pilot's and gunner's KU (here PLT_KU_2 and CPG_KU_2).

 

Yes, "tryToSendDcsBiosMessage" is the kind of a function to directly send commands to DCS Bios. I used that a lot within the code for my VHF FM radio, to send switch positions of a port expander.

Have a look into the source code of DcsBios to see that functionality: https://github.com/DCS-Skunkworks/dcs-bios-arduino-library/blob/master/src/DcsBios.h

 

In short the arguments may be explained as follows:

bool tryToSendDcsBiosMessage(const char* msg, const char* arg);

char* msg can be the name of a switch, same like you have already used in your sketch (e.g. "CPG_KU_2" for key 2 of your gunner's keyboard or "PLT_KU_2" for that of the pilot).

char* arg represents a value to be send to DCS Bios: for a two position switch it is either "0" or "1", or for multi position switches "0" to "max position (minus 1)".

Btw. that function also can send all the other input arguments, like "INC" or "DEC" to increase or decrease values e.g. for a channel selector knob (like with the rotaries).

Instead of tryToSendDcsBiosMessage you also can use sendDcsBiosMessage, but I recommend to leave it like that.

 

So you are able to directly send switch positions to DCS Bios, like the reading for pin 35:

if (digitalRead(35) == 0) DcsBios::tryToSendDcsBiosMessage("CPG_KU_2", "0");
if (digitalRead(35) == 1) DcsBios::tryToSendDcsBiosMessage("CPG_KU_2", "1");

(or the other way around if your switch is active LOW)

 

Be carefull to use it within the LOOP section, as it than permanently sends the read values. I therefore used variables to hold the actual status and send it only in case it has changed. Have a look into my VHF FM radio sketch linked below.

You may group your keyboard readings within different sections of a function.

Imagine, that a key may be send either from the gunner's or the pilot's KU, depending on the position of your (status) selector switch (input A3). You may have an idea of what I mean.

It's a lot of coding to be done, but on the other hand you build two separate input devices 😉

 

Regards, Vinc

 

 

Edit: I had a further look into the DcsBios library but havn't worked with the DynamicControlMapping.ino example yet.

If I understand the sketch right, it even may be adjusted to your input needs.

 

Edited by Vinc_Vega
spell checking

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

I would try to completely replace the onAcftNameChange function with a reading of your selector switch 😉

 

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
4 hours ago, Vinc_Vega said:

I would try to completely replace the onAcftNameChange function with a reading of your selector switch 😉

 

Regards, Vinc

Did you know this was a thing?
image.png

I'm also going to look into creating a 2-seat version of the switch function.

  • Like 1
Posted

No, as I don't have the AH-64 module I didn't had a look into it's code. But that sounds promising 👍

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
5 hours ago, No1sonuk said:

Did you know this was a thing?
image.png

I'm also going to look into creating a 2-seat version of the switch function.

I didn't either. Does that mean that I actually didn't need a physical switch? 

Posted

Not sure what the signal actually is triggered from. Just jump between the cockpits, read it out and you'll see.

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

It does work in bort, but when I add the code:

void onSeatPositionChange(unsigned int newValueSeat) {
  status = newValueSeat;
}
DcsBios::IntegerBuffer seatPositionBuffer(0x8750, 0x0100, onSeatPositionChange);

it gives me this error:

KU-DCS_BIOS_basic:153:79: error: no matching function for call to 'DcsBios::IntegerBuffer::IntegerBuffer(unsigned int, int, void (&)(unsigned int))'
 DcsBios::IntegerBuffer seatPositionBuffer(0x8750, 0x0100, onSeatPositionChange);
                                                                               ^
In file included from D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/DcsBios.h:14:0,
                 from D:\Escritorio\KU-DCS_BIOS_basic\KU-DCS_BIOS_basic.ino:3:
D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/internal/ExportStreamListener.h:97:4: note: candidate: DcsBios::IntegerBuffer::IntegerBuffer(unsigned int, unsigned int, unsigned char, void (*)(unsigned int))
    IntegerBuffer(unsigned int address, unsigned int mask, unsigned char shift, void (*callback)(unsigned int)) : Int16Buffer(address) {
    ^~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/internal/ExportStreamListener.h:97:4: note:   candidate expects 4 arguments, 3 provided
D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/internal/ExportStreamListener.h:91:8: note: candidate: constexpr DcsBios::IntegerBuffer::IntegerBuffer(const DcsBios::IntegerBuffer&)
  class IntegerBuffer : public Int16Buffer {
        ^~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/internal/ExportStreamListener.h:91:8: note:   candidate expects 1 argument, 3 provided
D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/internal/ExportStreamListener.h:91:8: note: candidate: constexpr DcsBios::IntegerBuffer::IntegerBuffer(DcsBios::IntegerBuffer&&)
D:\Documentos\Arduino\libraries\dcs-bios-arduino-library-0.3.9\src/internal/ExportStreamListener.h:91:8: note:   candidate expects 1 argument, 3 provided
exit status 1
no matching function for call to 'DcsBios::IntegerBuffer::IntegerBuffer(unsigned int, int, void (&)(unsigned int))'

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...