I tried to use the outputs for the Caution and Warning lights and while the log window shows their state changing, nothing can be retrieved using the provided getMasterWarningOn and getMasterCautionOn functions. My example code to turn on/off an LED looks like this:
myConnection.dataHandling();
bool masterCautionOn = myConnection.getMasterCautionOn();
if (masterCautionOn) {
digitalWrite(APU_LED_PIN, HIGH);
}else {
digitalWrite(APU_LED_PIN, LOW);
}
I looked into the .h file and noticed the function has a const declaration in it, that seems off as the value should not be a constant but be allowed to change?
bool getMasterWarningOn() const { return masterWarningOn; };
I then looked in the .cpp file and noticed that where was no entry for masterCautionOn or masterWarningOn. So I removed the "const" from above, and added to the .cpp:
case 1000: {
masterCautionOn = convBool(cutValue);
break;
}
This got the light to turn on. Now the light won't turn off. :) I see the log showing it sending "COM 7 --> 1000 0" but for some reason my code above isn't turning the light off so I'm not sure if the false state is getting sent or something. I used the same code above for getTaxiLight and it worked fine. So something if goofy with the caution/warning lights. Thanks!
I tried to use the outputs for the Caution and Warning lights and while the log window shows their state changing, nothing can be retrieved using the provided getMasterWarningOn and getMasterCautionOn functions. My example code to turn on/off an LED looks like this:
myConnection.dataHandling();
bool masterCautionOn = myConnection.getMasterCautionOn();
if (masterCautionOn) {
digitalWrite(APU_LED_PIN, HIGH);
}else {
digitalWrite(APU_LED_PIN, LOW);
}
I looked into the .h file and noticed the function has a const declaration in it, that seems off as the value should not be a constant but be allowed to change?
bool getMasterWarningOn() const { return masterWarningOn; };
I then looked in the .cpp file and noticed that where was no entry for masterCautionOn or masterWarningOn. So I removed the "const" from above, and added to the .cpp:
case 1000: {
masterCautionOn = convBool(cutValue);
break;
}
This got the light to turn on. Now the light won't turn off. :) I see the log showing it sending "COM 7 --> 1000 0" but for some reason my code above isn't turning the light off so I'm not sure if the false state is getting sent or something. I used the same code above for getTaxiLight and it worked fine. So something if goofy with the caution/warning lights. Thanks!