I intend to build a 2DOF flight Simulator Platform using initally two small servo motors. I am using Link2FS software by Jim to extract the Data from Flight Simulator X and intend to use Arduino Uno to drive two small servo's via a dedicated USB port.
Does anyone have a sketch to do this.
Sam
FSX control of Servos for motion Platform
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: FSX control of Servos for motion Platform
It would help if you added more detail. How does the program output the data to the serial port and what is the format of the data?
-
- Posts: 2
- Joined: Thu Nov 01, 2012 11:30 pm
Re: FSX control of Servos for motion Platform
Franklin.franklin97355 wrote:It would help if you added more detail. How does the program output the data to the serial port and what is the format of the data?
Thanks for the time. I intend to use link2fs software to output the data to the serial port. This enables me to select which output I need for the 2dof i.e. pitch and roll. I some how did this and can see the chart provide different outputs as FSX flies.
I am advised that the Arduino Uno can read this and with the correct sketch can drive two small servos.
I copied this sketch (below) from "Jim page NZ" but when I try to upload I receive a "char" to "const char" error message.
Not being a software person I am stumped.
Thanks in anticipation of any help.
Sam
// pitch
// by BANNED <http://BANNED.com>
// This example code is in the public domain.
#include <Servo.h>
Servo myservopitch;
int j1;
String pitch,pitchold;
void setup()
{
myservopitch.attach(9);
Serial.begin(115200);
}
void loop()
{
if(Serial.available()>0){
j1= Serial.read();
if(j1=='A'){
delay(5);
pitch =char(Serial.read());
pitch+=char(Serial.read());
pitch+=char(Serial.read());
pitch+=char(Serial.read());
pitch+=char(Serial.read());
pitch+=char(Serial.read());
if(pitch!=pitchhold){
char carray[9];
pitch.toCharArray(carray,sizeof(carray));
int n=ato(carray);
n=map(n,-90,90,0,179);
myservopitch.write(n);
pitchold=pitch;
}
}
- jim nz
- Posts: 1
- Joined: Wed Nov 28, 2012 4:11 pm
Re: FSX control of Servos for motion Platform
Sam,,
You are trying to use a PDE that was written in Arduino IDE version 0022 but it wont compile in the later IDE's.
Most of my stuff has been updated so it works on version 0022 right thru to the latest version 1.1 so download a later PDE and see how you go.
All the newer stuff is available here ,,
Jimspage.co.nz/intro.htm
Good luck and have fun ,,, Jim
You are trying to use a PDE that was written in Arduino IDE version 0022 but it wont compile in the later IDE's.
Most of my stuff has been updated so it works on version 0022 right thru to the latest version 1.1 so download a later PDE and see how you go.
All the newer stuff is available here ,,
Jimspage.co.nz/intro.htm
Good luck and have fun ,,, Jim
-
- Posts: 6
- Joined: Fri Nov 29, 2013 8:14 pm
Re: FSX control of Servos for motion Platform
did you ever have any luck... I'm trying to set up a 2dof sim myself and using wiper motors. I have an uno and a l293d motor board but no sketches or any idea how to interface with fsx... Good luck...
Please be positive and constructive with your questions and comments.