Teensy 3.5 and X-Plane

Status
Not open for further replies.

P Dobson

Active member
Hi,

I am trying to get data from X-plane to Teensy 3.5. I started with a fairly complex project which I just could not get to work so I have slowly stripped it back to virtually nothing. This code runs and works on a teensy 2++. whilst I can see it running on the Teensy 3.5 it is not forwarding data from X-Plane even though the X-Plane plug in Comms. shows the correct data being output.

In Tools I am using Board - Teensy 3.5; USB type - Flight Sim Controls.

Any help to a novice coder like me very welcome.

Peter D.
 

Attachments

  • T3_5_syncho_drive_test.ino
    550 bytes · Views: 243
An Update. As per other Threads, if I declare the Flight Sim variable as "FlightSimInteger", the whole thing works. but doesn't on Teensy 3.5 if I use "FlightSimFloat".

So quite pleased it now works but increments of 1 Kt on the ASI are a bit steppy. So it would be nice to learn how to make it work with "float"...............

BR Pete D.
 
Hi Ben,

Thanks for getting back to me. I followed your thread all the way through to Paul's modification to Corrected typecast in "usb_flightsim.cpp" at line 222 where he amends it from Long to Float. I made the change but it did not solve the problem. So like you, I'm still searching.

Interestingly using the "Map" command does not work either, it comes up with an error saying:

no matching function for call to 'map(FlightSimInteger&, int, int, int, int)' Again this works on Teensy 2++.

BR Pete D.
 
Last edited:
no matching function for call to 'map(FlightSimInteger&, int, int, int, int)' Again this works on Teensy 2++.

The map() function was "improved" to automatically detect if you use integer or float. Previously it only worked as integers, discarding anything beyond the decimal point if you had floating point numbers.

But now you need to give it a little hint what using special data types like flight sim variables, so it "knows" which type you want. Just do something like this:

Code:
  map((long)mySimVar, 0, 1000, 50, 100);

Or cast it to float if you want the answer in floating point with resolution better than rounding to integers. The new map() offers that option.
 
Thanks for your help Paul.

Still struggling with flightSimFloat (don't work) and flightSimInteger (which do work) on Teensy 3.5. maybe you are not supporting this any more??

Have A GREAT Christmas.

BR Pete D.
 
Status
Not open for further replies.
Back
Top