PDA

View Full Version : JeeHell and link2Fs offsets



mikatsan
02-25-2016, 04:41 AM
Hello, i am trying to built my own fcu.


I use a LeoBoard for send button clicks with success!

The other thing i am up to is connecting led for showing if buttons are active. For example AP1 if is active led is on, if not led is off.

I do this with an Arduino and link2FS expert. I put in the FSUPIC(1) tab the corresponding offset value.

For example for showing Heading on LCD screen i use the following code aasigned to #c (link2fs

if (CodeIn == 'c'){
delay (11);
hdg = "";
hdg += char(Serial.read());
hdg += char(Serial.read());
hdg += char(Serial.read());

if (hdg.toInt()<-1){
lcd.setCursor(0,0);
lcd.print("HDG:");
lcd.setCursor(4,0);
lcd.print("000");
lcd.setCursor(4,0);
lcd.print(" * ");
}

if (hdg.toInt()>-1){
lcd.setCursor(0,0);
lcd.print("HDG:");
lcd.setCursor(4,0);
lcd.print("000");
lcd.setCursor(4,0);
lcd.print(hdg);
}
}




What i cannot understand is for AP1 for example. I use the offset 7390 (according to JH offset table) to take a value
I see that AP1 is on when i receive three different values. Its one depends on other buttons state. For example if AP1=ON & FD=OFF, i have different value from AP1=ON and AP2=OFF. So i have to make all the following combinations.

Whats my code bellow...

Am i doing something wrong? There is no way to retrieve state for every button alone??


if (CodeIn == 'd'){

delay (11);
code_d = "";
code_d += char(Serial.read());
code_d += char(Serial.read());
code_d += char(Serial.read());


if (code_d=="000"){
//fdstatus="OFF";
digitalWrite(8, LOW); //ALL OFF
//digitalWrite(12, LOW); //
}

if (code_d=="129" || (code_d=="133") || (code_d=="135") || (code_d=="143")){ //AP1 ON
//fdstatus="ON";
digitalWrite(pAP1, HIGH); //AP1
//digitalWrite(12, HIGH); //
}
else{
digitalWrite(pAP1, LOW);
}



https://www.youtube.com/watch?v=eJTF6hLw_vo



Thank you in advance,

Michael

mikatsan
03-01-2016, 04:24 AM
Well, since no one helped.... :( i found the solution converting the value to binary and reading the corresponding digit.

I now have another question regarding the vertical speed. Everything its ok when they are positive, but when they are negative i dont know how to convert them (multiply, divide ??) to the correct one.

Thank you in advnace