Jump to content

zitronen

Members
  • Posts

    692
  • Joined

  • Last visited

Everything posted by zitronen

  1. Serial port (TTL or RS232) and i2c are not the same thing, https://www.robotshop.com/community/forum/t/serial-vs-i2c-communication/12316 Serial port (over USB) is used by the Arduino to communicate with KSP
  2. Any reason why you are using 9600 for serial, not faster? Default should be 38400, but use fastest speed your board supports. lcd.clear() might be slow, if you are overwriting the display you could get rid of it. Otherwise I don't know? Have you tried just printing a simple line and see if that works?
  3. SDA SCL are for i2c, the mega has like 3 hardware serial ports, pin numbers are listed here: https://www.arduino.cc/en/reference/serial>
  4. LiquidCrystal possibly, SoftwareSerial can definitely cause problems. Do you need to use another serial port? I would recommend getting a board with 2 hardware serial ports rather than using softwareserial which is not only slow but also locks up the processor when it's working, which will lead to packet loss.
  5. You don't have anything like "delay(xxx)" in your code right? You can post which you changed here, or put it in pastbin or something if you can't figure it out yourself.
  6. Hi, apologies for the late reply, do you still need help with this? Just to confirm that the default Demo17 code works ok?
  7. Hi if you are using the demo code and not using the throttle on the arduino, you need to change the settings.cfg file to disable it (see first post for options).
  8. Update 0.19.3b: Changes: Ok so not sure when this happened, but it seems you no longer have to disable SAS to update vessel controls, so the annoy issue of having to disable SAS to move an axis is gone (the whole business with SASTol no longer an issue, it now doesn't do anything). Now the axis control behaves like normal joystick input. I didn't do anything apart from remove the check and doing some testing. Please let me know if this is actually fixed, that would be great! Thanks to @c4ooo for letting me know. Also recompiled against 1.10.1 Plugin download link: https://sites.google.com/site/zitronfiles/KSPSerialIO_019_3b.zip Arduino code dowload (same as before): https://sites.google.com/site/zitronfiles/KSPIODemo17.zip Basically what @Freshmeat said. Because we use the serial port, and need to support lower end arduino boards without a lot of RAM, we can't just send all the data. That's the limitation of this plugin. I never thought people would want to sending so much data to the arduino at the beginning. Surely 250 bytes ought to be enough for everybody.
  9. Huh.. weird... Anyway so now axes work fine with SAS on? What did you do, just delete the SAS check?
  10. In the config file: Enable value settings for axes: 0: The internal value (supplied by KSP) is always used. 1: The external value (read from serial packet) is always used. 2: If the internal value is not zero use it, otherwise use the external value. (Now default!!!) 3: If the external value is not zero use it, otherwise use the internal value. So if you set ThrottleEnable to 3, then the plugin will use your arduino throttle when it's not 0. You could for example have a switch to only send 0 when it's off and send analog input when it's on.
  11. Working fine for me so far, but I don't using everything available on my setup. Let me know if you have problems. Edit: updated SpaceDock/CKAN
  12. Jesus.. When I started this I thought surely 255 bytes should be enough for everybody...
  13. Unfortunately not right now. I think we talked about it back in the days. Getting more info in the controlpacket is easy, but getting things working with other mods will be annoying, you have to worry about which version of KSPSerialIO supports which version of AGE, for which version of KSP. When KSP updates you have to make sure both mods are updated. Then also you have to make sure things don't break for people who don't use AGE... An easier work around is just to use an Arduino Leo in keyboard emulation mode and bind the keys to AG(R)E.
  14. The SAS thing unfortunately is the only way I can get axes to work. Not an optimal solution, I recommend using an arduino leo in USB HID joystick mode and directly bind them in KSP input options. This might also solve your second problem as well.
  15. Hi @OKB_Carba I figured out what's wrong. Changing SAS mode only works when SAS is already on! Completely forgot about this. It was designed to be used with more than one switches, one to turn SAS on, and others to change mode. So if you have two pins, you can do this: if (digitalRead(SASPIN)) { //--------- This is how you do main controls MainControls(SAS, HIGH); } else { MainControls(SAS, LOW); } if (digitalRead(CG1PIN)) setSASMode(SMPrograde); //setting SAS mode to prograde else setSASMode(SMSAS); //setting SAS mode to normal If you only want to use a single switch you will have to manually code something in the if statement like (not tested, but should work): if (inputpin == high) { MainControls(SAS, HIGH); if ((ControlStatus(AGSAS) == True) && (getSASMode() != SMPrograde)) //if control group SAS is on and not in prograde mode setSASMode(SMPrograde) else ... } else ... Sorry about the confusion. Unfortunately, because the fuel code I stole from mechjeb only works by traversing through connection nodes, surface attached engines don't work. I have no idea how to fix this, I had to copy stuff from more competent people just to get fuel working.
  16. Sorry guys, I have some other things to worry about right now, will have a look at this later, maybe this weekend. @OKB_Carba @Wurmi
  17. Ah I think it's because you are using MainControls(PROGRADE, HIGH); If you set MainControls(PROGRADE = 8) you are actually turning on action group 3. The list of things that can be controlled by MainControls() are //Action group statuses #define AGSAS 0 #define AGRCS 1 #define AGLight 2 #define AGGear 3 #define AGBrakes 4 #define AGAbort 5 #define AGCustom01 6 #define AGCustom02 7 #define AGCustom03 8 #define AGCustom04 9 #define AGCustom05 10 #define AGCustom06 11 #define AGCustom07 12 #define AGCustom08 13 #define AGCustom09 14 #define AGCustom10 15 What you should do is else if (digitalRead(PROGRADEPIN)){ //same estructure as above MainControls(SAS, HIGH); //Input enum for PROGRADE SAS Mode setSASMode(SMPrograde); //Setting SMPrograde }
  18. OK I fixed it! Update 0.19.2: Changes: Fixed very old bug of auto detection and connection with high number (>10) COM ports, thanks to detective work from @Jimbofarrar Plugin download link: https://sites.google.com/site/zitronfiles/KSPSerialIO_019_2.zip Arduino code dowload: https://sites.google.com/site/zitronfiles/KSPIODemo17.zip
  19. Sorry for the late reply, I'm having some issues with your code. It works fine the first time, but when you revert flight and go back to launch it stops working. I'm trying to figure out what's going on.
×
×
  • Create New...