I am trying to send some information regarding the stall status of a yasim aircraft from FG to Arduino, I am using a simplified xml and arduino code just for testing, I am trying to populate a simple two member array but is not working, I am running windows 10, with FG 2020.1.3
ANY idea will be most appreciated, cheers and thanks.
the xml as follows:
- Code: Select all
<?xml version="1.0"?>
<output>
<line_separator>newline</line_separator>
<var_separator>,</var_separator>
<chunk>
<name>surface</name>
<node>/fdm/yasim/debug/surfaces/surface/alpha</node> // this is node 0 from debug that has stall information about surfaces
<type>float</type>
<format>%1.3f</format>
</chunk>
<chunk>
<name>surface</name>
<node>/fdm/yasim/debug/surfaces/surface[1]/alpha</node> // this is node 1 from debug that has the information about surfaces
<type>float</type>
<format>%1.3f</format>
</chunk>
</output>
The Arduino code:
- Code: Select all
int pinArray[2]={0,1}; // this is the array I am trying to populate with the FG information
void setup() {
// put your setup code here, to run once:
pinMode(pinArray[1],OUTPUT);
Serial.begin(9600);
if(Serial.available()>0);{
pinArray[2]=Serial.read();
}
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print(pinArray[0]);
delay(300);
Serial.print(pinArray[1]);
delay(300);
}
and the socket:
- Code: Select all
fgfs --generic=serial,out,10,COM3,test_out