FSX control of Servos for motion Platform

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

FSX control of Servos for motion Platform

Postby SamSpiteri » Thu Nov 01, 2012 10:54 pm

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
SamSpiteri
 
Posts: 2
Joined: Thu Nov 01, 2012 10:30 pm

Re: FSX control of Servos for motion Platform

Postby franklin97355 » Fri Nov 02, 2012 9:56 am

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?
User avatar
franklin97355
 
Posts: 1705
Joined: Mon Apr 21, 2008 1:33 pm

Re: FSX control of Servos for motion Platform

Postby SamSpiteri » Wed Nov 07, 2012 7:35 pm

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?


Franklin.

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 BARRAGAN <http://barraganstudio.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;
}
}
SamSpiteri
 
Posts: 2
Joined: Thu Nov 01, 2012 10:30 pm

Re: FSX control of Servos for motion Platform

Postby Jim NZ » Wed Nov 28, 2012 3:19 pm

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
Jim NZ
 
Posts: 1
Joined: Wed Nov 28, 2012 3:11 pm


Return to Arduino

Who is online

Users browsing this forum: Google [Bot] and 8 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [105]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
Android[6]
 
BeagleBone[24]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]