Results 1 to 5 of 5
  1. #1
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    210
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Arduino pitch, roll. and yaw control

    Branch of a post by AndreasTang to Jim's thread "LINK2FS MULTI FSX v6 for EXPERTs released" in the Arduino Cards and Link2FS forum.

    Any progress since September?

    Jim has posted that creating inputs for roll, pitch, and yaw would be a lot of work in view or the few people not using off the shelf joysticks, yokes, or components adapted to homebuilt yoke or rudder pedal assemblies. The problem seems to be with input of negative values required for the three primary axes. Using 'Experts > Simconnect Inputs, left rudder is smooth from zero to full deflection, but if you try to move the rudder to the right, the rudder moves immediately to full left deflection.

    SimConnects uses values 0 to 16,383 for left rudder and 0 to -16383 for right rudder. When the potentiometer output is expanded by map(output, 0, 1023, -16383, 16383) and the stored value is handled as an unsigned variable, -1 is decoded as +65,535 (give or take 1 or more) which puts the rudder to the left of full left deflection. I tried this checking the HEX box for the line in 'Experts > Simconnect Inputs' with the same results. Then tried the same procedure with 'Experts > Controls' and again found only left rudder movement with the the HEX box unchecked, and intermittent or no rudder control with the HEX box checked.

    The sim is currently more construction bench than finished sim and am not doing enough flying to allot space for both keyboard and joystick. When flight is required to test the latest addition, keyboard pitch and roll control is good enough to get off the ground. I want better yaw and rudder trim. There is an Arduino Pro Micro clone on order and will try to build a small USB rudder (or other axis) control using a rotary pot. Will post any results.

    Hugh
    Last edited by BushPilotWannabe; 10-22-2017 at 01:41 PM. Reason: was it 14, 15, or 16 bit
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  2. #2
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    210
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino pitch, roll. and yaw control

    UPDATE. Pro Micro joystick project was put on back burner for some time. A sketch has been created using Arduino joystick.h library for the Arduino Pro Micro clone board. The Windows 'calibrate joystick' utility recognizes input from both x and y axes, but while FSX does recognize the Pro Micro as a USB joystick device it will not move aircraft surfaces. Has anybody solved this problem? Hugh
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  3. #3
    New Member
    Join Date
    May 2013
    Location
    sydney
    Posts
    1
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino pitch, roll. and yaw control

    This joystick and inputs works for me in FSX. Please note that none of this is my own work. I simply followed https://github.com/MHeironimus/ArduinoJoystickLibrary and assigned the Leonardo joystick in the FSX Controls menu.regards.
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    210
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino pitch, roll. and yaw control

    Thankyou. It must be my set up of the pro Micro clone board, or I gutted the demo sketch too aggressively, or bad USB chip. Maybe the two pro Micro clones inbound with USB mini connectors will fix the problem. Give me a day to run your code. Hugh
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  5. #5
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    210
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino pitch, roll. and yaw control

    02 January 2020 PROBLEM SOLVED. Thank you. That's what I needed for a small footprint joystick until the build is far enough along to permanently mount a flight yoke. Lessons Learned Do not use signed integers where unsigned integers are required. Pro Micro clones should use the Arduino > Tools > Board 'Leonardo' selection, not 'Pro Micro'. Funny thing, is while the board was identified as 'Leonard ETH', FSX Gold, on Windows 7 provided only maximum deflection at that setting. After changing board selection to 'Leonardo' deflection became proportional. 'Leonard ETH' selection worked on a Windows 10 computer running FS2002. The computer USB controller does not like my Pro Micro board. No problem hot plugging into powered USB HUB slot. Eventually Link2FS stopped freezing up. Probably due to a wrong connection in the radio stack made week before getting your post. To drive only joystick X and Y axes, I commented out everything in void loop() but xAxis = analogRead(A0); xAxis = map(xAxis,0,1023,-127,127); yAxis = analogRead(A1); yAxis = map(yAxis,0,1023,-127,127); Joystick.setXAxis(xAxis); Joystick.setYAxis(yAxis); delay(50); Control of the elevator is good - a half turn of ten turn pot either way is usually sufficient, however, the aileron knob goes round like the helm on a windjammer changing tack. A turn counter for 1/4" shaft pot might help if there is one available locally. Hugh
    Last edited by BushPilotWannabe; 02-04-2020 at 11:02 AM. Reason: Tried to put some formatting into the post.
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013