Jump to content
The simFlight Network Forums

cheeseburger

Members
  • Content Count

    14
  • Joined

  • Last visited

Everything posted by cheeseburger

  1. Of course, no problem sir. Yeah, I tried use fixed length, but it will be better for me, if I could use different length blocks :) Thank you.
  2. Hello sir, is possible to check problem which I mentioned? Thank you in advance :)
  3. Hi folks, I am trying change altitude on MCP by rotary encoder, unfortunately I am not sure if I send to ipc.control correct data ipc.control(70032, altitude) value in altitude is correct, I have there (100,200....1000,1100.......12000....) It works only for first three hundred, and then even though I change altitude value by rotary, the value on MCP will not change. Could someone help me? Thank you. EDIT: I tried to send it real altitude /100. This works fine, but only for increasing altitude. If I turn with rotary to anti-clockwise position, the value is decreasing, b
  4. If you set it by LUA script, use this. ipc.control(69749, 536870912) Always when you call this function it will be turning off/on/off/on...
  5. No problem, I will remind it to you. thank you once more :)
  6. This is my LUA and arduino code: serial_wait = 100 dev = com.open("COM3", 921600, 0) --com, speed, handshake if dev == 0 then ipc.display("Could not open device port") ipc.exit() end function readSerial(handle, string) ipc.log("com: " .. string) end event.com(dev, 16, 1, '\n', "readSerial") void writeOffset(const char* controlName, int value){ char sendData[16]; sprintf(sendData, "%s:%d\n", controlName, value); Serial.write(sendData); Serial.flush(); } This is what I get when I quick turning rotar .. 6516162 LUA.0: com: alt:5400 alt:550 6516178 LUA.
  7. Thank you very much. I think my previous problem is solved, but there is one more. When I quickly turning rotary encoder, I get something like this 1266526 LUA.0: com: alt:6300 1266931 LUA.0: com: alt:6400 alt:6500 1266994 LUA.0: com: alt:6600 alt:6700 1267025 LUA.0: com: alt:6800 I still only read the strings. It seems like I get two string at once. Is this normal or not? At morning it works great, but now it is again bad :/
  8. I use Arduino UNO. There is possibly use only one serial. However I use software serial ( https://www.arduino.cc/en/Tutorial/SoftwareSerialExample ) , so I connected second arduino, and send string at the same time to serial link(FSUIPC) and to other Arduino. Data from second arduino I read by putty terminal. I agree 10 000 is very much, I have only tried it if it will change something in my problem. I will try use terminator in event.com. I would like to have one more question. Which baudrate do you recommend? In documentation is mentioned 115200 for VRInsight, also 4800 or 9600. I use own pu
  9. Thank you, I noticed one strange thing and maybe where is problem. Now I tried in FSUIPC only read the strings without any reaction. When I send some string to serial link from arduino, sometimes I get only "alti" or something similar as I said. Problem is that next part of string "meter:1000" I get when I turn with rotar again, and usually i get rest of string with new one - "meter:1000\naltimeter:1100". The problem is in LUA script, because I tried to send strings also to other COM port at the same time, and strings are correct, only in LUA are incorrect. This is my code in LUA. s
  10. Thank you for you replies. :) I tried to connect rotary encoder, and I have a same problem, so it will be problem somwhere in serial communication. I will try to detect some special char, unfortunately I am not sure if I know how to read by char for serial link in LUA script.
  11. Sorry for my late reply. Of course it does not matter how the log looks. This part of code which I posted here, should be push button for parking brake. Unfortunately, when I get by serial link to FSUIPC something like this "br" or "ake:1" LUA script does not know, what is it and what to do. Thank you in advance :)
  12. Hi folks, I work on MCP based on Arduino. I read/write offsets through FSUIPC by LUA script. Unfortunately I have one problem. I tried to explain it with parking brake. I have on push button. The code in arduino: ... void pushButton(){ button = digitalRead(prkgbrake); if (button == HIGH && exbutton == LOW && millis() - last > ddelay){ Serial.write("brake:1\n") while( digitalRead(prkgbrake) == HIGH){ } } } ... and this is LUA script .... x = com.open("COM3", 115200, 0) function offset(handle, str) ipc.log(str) end event.com(
×
×
  • 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.