Jump to content
The simFlight Network Forums

Binkles

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by Binkles

  1. Thanks for that, The displaying of it works if I use the p3d radio dials. It's using my arduino radio dials, I can't seem to send a correct value back.
  2. Social commentary again :) Ok, so I have changed it a little, as I was still missing jumps, and now have reading the values working 100% up to FL400. Problem is in the sending back.. ipc.control(65892,1) should be the code to send to increase the ap altitude correct? I've tried offset writes, but gremlins start to appear after a bit of use. I would rather send offsets, but yeah.... I'm not having much joy.
  3. Ok, found it out, and boy do I feel stupid... Sending offset/65536... In the arduino receive the number x x/3*100 does the trick!!!!
  4. Thanks for that, yes it worked :) But it's not accurate - I think because I was trying to truncate it too much (4 characters). But everynow and again it keeps missing a number. So it may display 1900 in the sim, but shows 2000 on the display - and then 2000 on the sim, and still 2000 on the display. I've tried all sorts of conversions... So I've changed the script so it sends offset value/65536 What manipulation can I perform on this to get accurate readings on the lcd and the plane. Or am I at a point where I need to put in an array and all the inaccurate numbers write a correct one) I'm using the feet value of 3.28083989501312
  5. Ok, Thanks to Paul, I managed to get my radios working. I've managed to get heading, obs, and ias working for an AP. But having issues with altitude. send_padded("altitude", alt/100,4); // alt was 600 so sends 6 to the function void send_padded ( char* name, int value, int padded) { char buffer [20]; switch (padded){ case 4: sprintf (buffer, "%s:%04d\n", name, value); break; } // lcd2.setCursor(0,3); // lcd2.print("S:"); // lcd2.print(buffer); Serial.write (buffer); } So this would send altitude:0006 to lua if string.match(str, "altitude:(%d)") then state = tonumber(string.match(str, "altitude:(%d)")) current = ((state*65536)*foot/100) ipc.writeUD(0x07d4, current ) end But this isn't setting the correct value, as the plane still shows 00000 If I update the plane it comes up 100 short in my code as well... value = (value/65536)* foot/100 is the code I use to send to the arduino. Literally pulling my hair out, and freaking out about the codes for the vertical speed as well. These are the last two areas that I have left to complete my radio/ap panel.
  6. So I've got an Arduino running radios etc, but I can't get it to swap the frequencies. I send the code from my arduino "swapc1" Lua accepts this, but I can't get the following to work. Sent from Arduino: swapc1:1 char buffer [20]; sprintf (buffer, "%s:%d\n", name, value); // lcd2.setCursor(0,3); // lcd2.print("S:"); // lcd2.print(buffer); Serial.write (buffer); Lua Script if string.match (str,"swapc1:(%x)") then ipc.control(66444,1) end I did have a script trying to manually swap them as well, but would rather use the presets. Anyone able to assist?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.