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;
}
}