Hy,
thanks for your posts, i get it work but not as i wanted.
But first here a few pictures of my cockpit
I have build here 3 different input types: Joystick, Keyboard and arduino
The Joystik controls Pitch and Yaw, Firebutton is Stage, then switch map SAS and RSC activate/deaktivate and controls view
The Linear Poti with the red cap controls the Throttle. The big hole there was a mistake but later it will cool the Hand with a Computer fan.
Then we have the three LEDs, The Display and the poti under the display is to switch the display. Actually 4 Modes. 1 AP and EP 2. Altitude 3. MonoP and Electric Charge 4. Time to Node and DeltaV
The small Joystik on the left Controls Translation Up,Down,Left,Right. The two red buttons control the Roll Axis. The small button under the Joystik Controls RCS Foward and Backward.
Here is a video from the start.
As you can see the start works nearly correctly. With two exceptions. RCS and SAS won´t go active. (At home SAS and RCS went active after the for loop) And the stage should be switched after countdown goes to 1.
if ( start == HIGH)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("KSP Start Check");
delay(500);
//RCS Check
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("***RCS Check****");
delay(1000);
//RCS Einschalten
CPacket.MainControls |= (1 << 6);
lcd.setCursor(0,1);
lcd.print("Checked");
delay(1000);
//SAS Check
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("***SAS Check****");
delay(1000);
//SAS Einschalten
CPacket.MainControls |= (1 << 7);
lcd.setCursor(0,1);
lcd.print("Checked");
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("****LED Check***");
digitalWrite(GLED,HIGH);
delay(1000);
digitalWrite(YLED,HIGH);
delay(1000);
digitalWrite(RLED,HIGH);
delay(1000);
digitalWrite(GLED,LOW);
delay(1000);
digitalWrite(YLED,LOW);
delay(1000);
digitalWrite(RLED,LOW);
lcd.setCursor(0,1);
lcd.print("Checked");
//Fuel Check
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("***Fuel Check***");
delay(1000);
//Fuel Auslesen
lcd.setCursor(0,1);
lcd.print(VData.LiquidFuelTot);
delay(1000);
//MonoP Check
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("***MonoP Check**");
delay(1000);
//MonoP Auslesen
lcd.setCursor(0,1);
lcd.print(VData.MonoPropTot);
delay(1000);
//Power Check
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("*E Charge Check*");
delay(1000);
//Echarge Auslesen
lcd.setCursor(0,1);
lcd.print(VData.ECharge);
delay(1000);
lcd.clear();
for ( int t = 10 ; t >= 0 ; t--)
{
if(t |= 0)
{
lcd.setCursor(0, 0);
lcd.print("Ready to start");
lcd.setCursor(0,1);
lcd.print(t);
delay(1000);
lcd.clear();
}
else
{
CPacket.MainControls |= (1 << n);
lcd.setCursor(0,0);
lcd.clear();
lcd.print("*****Engage*****");
delay(2000);
}
}
start = LOW;
lcd.clear();
}
}
if i set start = low it won´t restart anymore.
For the "Waiting for KSP" Loop i have actually no solution.
With target i mean if you select an other Vehicle for Docking etc KSp schow you the distance an relative speed to the target. I want this informations on my display.