Hi guys.
Doing some programming with DCS-Bios. (DCS simulator interface) PC to Arduino in a Simulator
One of the issues is the engine RPM is exported as a char of only 2 digits. But will show on the virtual screen as 100-104%.
But in the mimic screen in the simulator the value returns a 10 after 99% as the last 0 is no read.
The mimic screen can accomodate the 3 digits.
Thus.
How can I code the input from DCS to change any value of 10 to 100 (ie 10 x 10).
This seams simple enough in my head but I can’t find the right code. Get lots of errors saying like
“Forbids comparison between a pointer and and integer“
Or
“Invalid operands of types ‘char*’ And ‘Int’ to binary ‘operator*’
Using the Below libraries.
DCSBios.h
Nextion.h
Arduino.h
Code sinipit below is the one that works but only limites the output to the Nextion to the two digits as that’s all the PC will send.
How can I modify the below to change the returned value of 10 (really 100 but the last 0 not sent to the Arduino) show 100 in RPML
Yes I have checked the DCS Bios buffer. There is only 2 digits. The next Hex location is the start of RPMR (Right engine) also only 2 char requested.
Below code is the working code.
int RPML; // RPM LEFT ENGINE
#####(I have missed code here That is working or not relevant ) ####
void onIfeiRpmLChange (char* RPML) { // this reads the code Buffer listed below from the PC game
nextion.print(“t0.txt=\””); // sends code for text box 1 on the Nextion
nextion.print(RPML);
nextion.print(“\””);
nextion.write(0xFF);
nextion.write(0xFF);
nextion.write(0xFF);
}
DcsBios::StringBuffer<2> ifeiRpmLBuffer(0x7494, onIfeiRpmLChange);
Yes I have changed the above to <3>. But as before there is no 3rd digit in the buffer, it returns the 1st number for the second engine.