***** Arduino code for G-Seats by @Spit40: https://www.xsimulator.net/community/threads/007-g-seat-ultra-compact-servo-based.10470/#post-139756
***** RC servo Code for Arduino UNO - 2DOF - Expandable 2.0: by eaorobbie
http://www.xsimulator.net/community/marketplace/rc-model-code-for-arduino-uno-2dof-expandable.89/
https://www.xsimulator.net/community/threads/rc-model-for-motion-simulation.4600/
interface setup - IMPORTANT - Assuming a 2DOF for SimTools 2 the Interface Output should be set like this R<Axis1a>~L<Axis2a>~
and for expanding code to use more servo http://www.xsimulator.net/community/threads/my-project-guide-me.5682/#post-59262
To add servos to my code , for example to include 4DOF with my code
Line 9 - How many Servos to use.
const int kActuatorCount = 4;
Line 13 - The Identifier used for Servo
const char kActuatorName[kActuatorCount] = { 'R', 'L' , 'F', 'B' };
Line 14 - Where is Servo is connected
const int kPins[kActuatorCount] = {3, 5, 6, 9};
Line 15 - 17 - Sets the scaleing in degrees of movement used , this is set for 180 deg if counting from 0
const int kActuatorScale[kActuatorCount][2] = { { 0, 179 } , // Right Actuator scaling
{ 179, 0 } , // Left side Actuator scaling
{ 179, 0 } , // Front side Actuator scaling
{ 179, 0 } }; // Back side Actuator scaling
Line 21 - Sets the Initial position of servo when in starts in Degree's
int actuatorPosition[kActuatorCount] = {90, 90, 90, 90};
Note in lines 15-17 if servo moves the wrong direction you can simply invert them by changing the scaling.