Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Xplane move aircraft

  1. #1
    Junior Member
    Join Date
    Apr 2017
    Posts
    7

    Xplane move aircraft

    Hi guys,

    Is there any functionality within the teensy plugin to utilise the xplm move aircraft?

    http://www.xsquawkbox.net/xpsdk/medi...MovingThePlane

    i'd like a button that moves the aircraft from say Heathrow to Edinburgh.

    Best regards

    Adam

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,308
    The Xplane support lets you write to any datarefs. You could try writing to 4 float variables for these datarefs:

    sim/flightmodel/position/latitude
    sim/flightmodel/position/longitude
    sim/flightmodel/position/elevation
    sim/flightmodel/position/y_agl

    To make a button do this, I highly recommend using the Bounce library. Look at File > Examples > Teensy > USB_FlightSim > NavFrequency for an example that uses Bounce to read buttons.

    Hopefully this should be as simple as just writing numbers to those 4 variables when button.fallingEdge() is true. You'll need to know the coordinates for Edinburgh.

  3. #3
    Junior Member
    Join Date
    Apr 2017
    Posts
    7
    Paul.

    Thanks for taking the time to respond, I understood the lat and lon dataref to be read only certainly nothing appears to happen when I try writing to them

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,308
    Oh, yeah, looks like those are read only. Maybe try asking on Xplane forums if the algorithm or source code for XPLMWorldToLocal is available?

    http://www.xsquawkbox.net/xpsdk/medi...LMWorldToLocal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •