Teensy 3.5, XPlane, and exit status 1

jonweisw2

Member
Hi all - I am new to this forum and very new to the the Teensy. I appreciate any advice anyone might have as to how to solve this problem and thank you for your patience.

I am building a static Boeing 727 simulator using all OEM parts. One element of the instrumentation requires that I transduce a synchro/control transformer (which is AC based), which is basically a way to determine where a heading bug is set on the face of a 360 degree instrument face. In order to do that, I have a synchro to digital converter which takes the signal from the synchro and converts it to a 14 bit 'word' where each pin of the converter is 'on' when it is supplied with 5vdc. I need the Teensy to read all 14 pins of the synchro converter and using some math come up with the angle in degrees that the heading bug is set to.

I have done all of the other elements of this project using Teensy 4.1's, but am aware that the 4.1 is limited to 3.3vdc. So, I bought up a bunch of Teen$y 3.5's in order to accommodate the 5vdc.

Those arrived today and I was eager to try it out. Unfortunately the code (which I suspect is very very simple relative to what others are capable of in this group) would not compile and I keep getting 'Compilation error. Exit status 1'. I have tried muting each line of the code and then adding them back one at a time and the problem starts as soon as I send it any code. The code will compile and go to a Teensy 4.1 without a problem. I am using the most current Arduino IDE and I have tried loading Arduino IDE v 1.8.16 without any luck. Note also that I have the Flight Sim Controls plug in running and the appropriate line checked in the tools/USB tab.

Here is the code:


/* define the pins for the 14 separate input channels*/
int dpin1 = 23;
int dpin2 = 22;
int dpin3 = 21;
int dpin4 = 20;
int dpin5 = 19;
int dpin6 = 18;
int dpin7 = 17;
int dpin8 = 16;
int dpin9 = 15;
int dpin10 = 14;
int dpin11 = 41;
int dpin12 = 40;
int dpin13 = 39;
int dpin14 = 38;

/* Hdgbug will link to XPlane to send the calculated angle to the simulation software. Hdgct will do the work of calculating the angle*/
FlightSimFloat Hdgbug;
FlightSimFloat Hdgct;


void setup (){
Serial.begin(9600);

pinMode(dpin1, INPUT);
pinMode(dpin2, INPUT);
pinMode(dpin3, INPUT);
pinMode(dpin4, INPUT);
pinMode(dpin5, INPUT);
pinMode(dpin6, INPUT);
pinMode(dpin7, INPUT);
pinMode(dpin8, INPUT);
pinMode(dpin9, INPUT);
pinMode(dpin10, INPUT);
pinMode(dpin11, INPUT);
pinMode(dpin12, INPUT);
pinMode(dpin13, INPUT);
pinMode(dpin14, INPUT);

/* Set the Hdgbug variable to the XPlane dataref*/
Hdgbug = XPlaneRef("sim/cockpit/autopilot/heading");

}


void loop() {
FlightSim.update();

/* read the 14ch output of the synchro converter*/
int pin1 = digitalRead(dpin1);
int pin2 = digitalRead(dpin2);
int pin3 = digitalRead(dpin3);
int pin4 = digitalRead(dpin4);
int pin5 = digitalRead(dpin5);
int pin6 = digitalRead(dpin6);
int pin7 = digitalRead(dpin7);
int pin8 = digitalRead(dpin8);
int pin9 = digitalgRead(dpin9);
int pin10 = digitalRead(dpin10);
int pin11 = digitalRead(dpin11);
int pin12 = digitalRead(dpin12);
int pin13 = digitalRead(dpin13);
int pin14 = digitalRead(dpin14);

/* reset the work variable to 0 with each cycle of the loop*/
Hdgct=0;

/*Heres where the calculations are made based on the output of the external converter. As an aside, I tried using the += operator and it didn’t like that..*/
if (pin1 == HIGH) {Hdgct = 180;}
if (pin2 == HIGH) {Hdgct = Hdgct + 90;}
if (pin3 == HIGH) {Hdgct = Hdgct + 45;}
if (pin4 == HIGH) {Hdgct = Hdgct + 22.5;}
if (pin5 ==HIGH) {Hdgct = Hdgct + 11.25;}
if (pin6 ==HIGH) {Hdgct = Hdgct + 5.625;}
if (pin7 ==HIGH) {Hdgct = Hdgct + 2.8125;}
if (pin8 ==HIGH) {Hdgct = Hdgct + 1.40625;}
if (pin9 ==HIGH) {Hdgct = Hdgct + 0.70313;}
if (pin10 ==HIGH) {Hdgct = Hdgct + 0.35156;}
if (pin11 ==HIGH) {Hdgct = Hdgct + 0.17578;}
if (pin12 ==HIGH) {Hdgct = Hdgct + 0.08790;}
if (pin13 ==HIGH) {Hdgct = Hdgct + 0.04395;}
if (pin14 ==HIGH) {Hdgct = Hdgct + 0.02197;}

/*Now the calculated angle gets sent to XPlane through the Hdgbug variable*/
Hdgbug=Hdgct;
}


Thank you SO much in advance for any guidance.
Jon
 
@jonweisw2 (Jon): It appears that you have a simple typo in the following line in your loop() function: int pin9 = digitalgRead(dpin9);, which should be changed to int pin9 = digitalRead(dpin9); (remove the extra "g").

Hope that helps . . .

Mark J Culross
KD5RXT
 
Mark -
You are correct but that occurred when I copied it into the post. I made sure it’s not there and it’s still throwing that error.

Thank you & 73’s!
Jon
KA3BPR
 
@jonweisw2 (Jon):

Can you please post the actual report from your failed build ?? For best readability, make sure to use the </> (code tags) when pasting the report into the new post.

Mark J Culross
KD5RXT
 
Do you have compiler output/warnings turned off?

Your code doesn't define FlightSimFloat, XPlaneRef, FlightSim - have you missed a #include?
 
Works for me - Teensy 3.5 and USB Type set to Flight Sim Controls or Flight Sim Controls + Joystick.

Code:
/* define the pins for the 14 separate input channels*/
int dpin1 = 23;
int dpin2 = 22;
int dpin3 = 21;
int dpin4 = 20;
int dpin5 = 19;
int dpin6 = 18;
int dpin7 = 17;
int dpin8 = 16;
int dpin9 = 15;
int dpin10 = 14;
int dpin11 = 41;
int dpin12 = 40;
int dpin13 = 39;
int dpin14 = 38;

/* Hdgbug will link to XPlane to send the calculated angle to the simulation software. Hdgct will do the work of calculating the angle*/
FlightSimFloat Hdgbug;
FlightSimFloat Hdgct;


void setup() {
    Serial.begin(9600);

    pinMode(dpin1, INPUT);
    pinMode(dpin2, INPUT);
    pinMode(dpin3, INPUT);
    pinMode(dpin4, INPUT);
    pinMode(dpin5, INPUT);
    pinMode(dpin6, INPUT);
    pinMode(dpin7, INPUT);
    pinMode(dpin8, INPUT);
    pinMode(dpin9, INPUT);
    pinMode(dpin10, INPUT);
    pinMode(dpin11, INPUT);
    pinMode(dpin12, INPUT);
    pinMode(dpin13, INPUT);
    pinMode(dpin14, INPUT);

    /* Set the Hdgbug variable to the XPlane dataref*/
    Hdgbug = XPlaneRef("sim/cockpit/autopilot/heading");

}


void loop() {
    FlightSim.update();

    /* read the 14ch output of the synchro converter*/
    int pin1 = digitalRead(dpin1);
    int pin2 = digitalRead(dpin2);
    int pin3 = digitalRead(dpin3);
    int pin4 = digitalRead(dpin4);
    int pin5 = digitalRead(dpin5);
    int pin6 = digitalRead(dpin6);
    int pin7 = digitalRead(dpin7);
    int pin8 = digitalRead(dpin8);
    int pin9 = digitalRead(dpin9);
    int pin10 = digitalRead(dpin10);
    int pin11 = digitalRead(dpin11);
    int pin12 = digitalRead(dpin12);
    int pin13 = digitalRead(dpin13);
    int pin14 = digitalRead(dpin14);

    /* reset the work variable to 0 with each cycle of the loop*/
    Hdgct = 0;

    /*Heres where the calculations are made based on the output of the external converter. As an aside, I tried using the += operator and it didn’t like that..*/
    if (pin1 == HIGH) { Hdgct = 180; }
    if (pin2 == HIGH) { Hdgct = Hdgct + 90; }
    if (pin3 == HIGH) { Hdgct = Hdgct + 45; }
    if (pin4 == HIGH) { Hdgct = Hdgct + 22.5; }
    if (pin5 == HIGH) { Hdgct = Hdgct + 11.25; }
    if (pin6 == HIGH) { Hdgct = Hdgct + 5.625; }
    if (pin7 == HIGH) { Hdgct = Hdgct + 2.8125; }
    if (pin8 == HIGH) { Hdgct = Hdgct + 1.40625; }
    if (pin9 == HIGH) { Hdgct = Hdgct + 0.70313; }
    if (pin10 == HIGH) { Hdgct = Hdgct + 0.35156; }
    if (pin11 == HIGH) { Hdgct = Hdgct + 0.17578; }
    if (pin12 == HIGH) { Hdgct = Hdgct + 0.08790; }
    if (pin13 == HIGH) { Hdgct = Hdgct + 0.04395; }
    if (pin14 == HIGH) { Hdgct = Hdgct + 0.02197; }

    /*Now the calculated angle gets sent to XPlane through the Hdgbug variable*/
    Hdgbug = Hdgct;
}
 
@MarkT - I thought that using that command wasn't necessary with the Flight Sim Controls line checked in the Tools/USB tab (none of my other sketches use it and they work fine). As I said, it compiles and will load on a 4.1 but not on the 3.5 (and I've tried a couple 3.5's)..

@BriComp - This is exactly what I was worried about - do you have any suggestions as to why it would work for you but not for me?

@kd5rxt-mark - Here ya go... I think this is what you are looking for, correct? I'm not sure how to format this any differently than what it sent, so apologies if this is difficult to read (let me know how to format it better and I'll repost).

FQBN: teensy:avr:teensy35:usb=flightsim
Using board 'teensy35' from platform in folder: C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
Using core 'teensy3' from platform in folder: C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0

Detecting libraries used...
C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH -IC:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\sketch\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp -o nul
Generating function prototypes...
C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH -IC:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\sketch\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp -o C:\Users\Jonathan\AppData\Local\Temp\4215419200\sketch_merged.cpp
C:\Users\Jonathan\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\Jonathan\AppData\Local\Temp\4215419200\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/precompile_helper" "C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0/cores/teensy3" "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8" "C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH "-IC:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0/cores/teensy3" "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8/pch/Arduino.h" -o "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8/pch/Arduino.h.gch"
Using previously compiled file: C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\pch\Arduino.h.gch
"C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH "-IC:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8/pch" "-IC:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\cores\\teensy3" "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8\\sketch\\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp" -o "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8\\sketch\\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp.o"
In file included from C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3/WProgram.h:65,
from C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\pch\Arduino.h:6:
C:\Users\Jonathan\Desktop\Sketches\MIP Sketches\HSI\MHR4B_HdgCrsBug_v2_Jmw\MHR4B_HdgCrsBug_v2_Jmw.ino: In function 'void setup()':
C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3/usb_flightsim.h:52:25: error: cannot convert 'const _XpRefStr_*' to 'float' in assignment
52 | #define XPlaneRef(str) ((const _XpRefStr_ *)(str))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| const _XpRefStr_*
C:\Users\Jonathan\Desktop\Sketches\MIP Sketches\HSI\MHR4B_HdgCrsBug_v2_Jmw\MHR4B_HdgCrsBug_v2_Jmw.ino:67:12: note: in expansion of macro 'XPlaneRef'
67 | Hdgbug = XPlaneRef("sim/cockpit/autopilot/heading");
| ^~~~~~~~~

exit status 1
 
@MarkT - I thought that using that command wasn't necessary with the Flight Sim Controls line checked in the Tools/USB tab (none of my other sketches use it and they work fine). As I said, it compiles and will load on a 4.1 but not on the 3.5 (and I've tried a couple 3.5's)..

@BriComp - This is exactly what I was worried about - do you have any suggestions as to why it would work for you but not for me?

@kd5rxt-mark - Here ya go... I think this is what you are looking for, correct? I'm not sure how to format this any differently than what it sent, so apologies if this is difficult to read (let me know how to format it better and I'll repost).

FQBN: teensy:avr:teensy35:usb=flightsim
Using board 'teensy35' from platform in folder: C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
Using core 'teensy3' from platform in folder: C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0

Detecting libraries used...
C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH -IC:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\sketch\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp -o nul
Generating function prototypes...
C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH -IC:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\sketch\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp -o C:\Users\Jonathan\AppData\Local\Temp\4215419200\sketch_merged.cpp
C:\Users\Jonathan\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\Jonathan\AppData\Local\Temp\4215419200\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/precompile_helper" "C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0/cores/teensy3" "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8" "C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH "-IC:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0/cores/teensy3" "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8/pch/Arduino.h" -o "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8/pch/Arduino.h.gch"
Using previously compiled file: C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\pch\Arduino.h.gch
"C:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_FLIGHTSIM -DLAYOUT_US_ENGLISH "-IC:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8/pch" "-IC:\\Users\\Jonathan\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\cores\\teensy3" "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8\\sketch\\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp" -o "C:\\Users\\Jonathan\\AppData\\Local\\Temp\\arduino\\sketches\\4594147538037D073ECF95A2E934D0D8\\sketch\\MHR4B_HdgCrsBug_v2_Jmw.ino.cpp.o"
In file included from C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3/WProgram.h:65,
from C:\Users\Jonathan\AppData\Local\Temp\arduino\sketches\4594147538037D073ECF95A2E934D0D8\pch\Arduino.h:6:
C:\Users\Jonathan\Desktop\Sketches\MIP Sketches\HSI\MHR4B_HdgCrsBug_v2_Jmw\MHR4B_HdgCrsBug_v2_Jmw.ino: In function 'void setup()':
C:\Users\Jonathan\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3/usb_flightsim.h:52:25: error: cannot convert 'const _XpRefStr_*' to 'float' in assignment
52 | #define XPlaneRef(str) ((const _XpRefStr_ *)(str))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| const _XpRefStr_*
C:\Users\Jonathan\Desktop\Sketches\MIP Sketches\HSI\MHR4B_HdgCrsBug_v2_Jmw\MHR4B_HdgCrsBug_v2_Jmw.ino:67:12: note: in expansion of macro 'XPlaneRef'
67 | Hdgbug = XPlaneRef("sim/cockpit/autopilot/heading");
| ^~~~~~~~~

exit status 1
I am using Arduino 1.8.19, with Teensy 1.60b3 on Windows 10
 
@MarkT - I thought that using that command wasn't necessary with the Flight Sim Controls line checked in the Tools/USB tab (none of my other sketches use it and they work fine). As I said, it compiles and will load on a 4.1 but not on the 3.5 (and I've tried a couple 3.5's)..

@BriComp - This is exactly what I was worried about - do you have any suggestions as to why it would work for you but not for me?

@kd5rxt-mark - Here ya go... I think this is what you are looking for, correct? I'm not sure how to format this any differently than what it sent, so apologies if this is difficult to read (let me know how to format it better and I'll repost).

Yes, the specific output helps to see exactly what the compiler/linker might be complaining about. I don't have any experience with Flight Sim. Like @BriComp, I'm using the latest Arduino 1.8.19 + TD1.60b3, along with the Flight Sim Controls USB type. I also am able to compile your sketch with no errors on my system. You mention using the latest Arduino IDE, but you also mention loading 1.8.16. So, I'd recommend uninstalling all copies of the Arduino IDE (in case you have multiple), then reloading the latest Arduino IDE 1.8.19 & reinstalling at least TD1.59, if not the latest beta to see if that corrects the problem.

Hope that helps . . .

Mark J Culross
KD5RXT
 
I thought that using that command wasn't necessary with the Flight Sim Controls line checked in the Tools/USB tab (none of my other sketches use it and they work fine).
I'm not aware of how Flight Sim is configured - those were the errors I got compiling the code you posted...
 
All -
Thank you for the help. After reinstalling everything, I noticed a small but ultimately significant error in my code which I think led to the problem. I had introduced a ‘float’ variable when I should have introduced a ‘FlightSimFloat’ variable (those who use the flightsimcontrols plugin will know what I’m talking about). Once corrected everything worked fine.
Thanks again.
Jon
 
Back
Top