Jump to content

zitronen

Members
  • Posts

    692
  • Joined

  • Last visited

Everything posted by zitronen

  1. OK, I probably need to compile a list about windows 10, since the useful info is scattered all around the thread. I am using a crappy serial library because KSP (Unity, mono) does not include it, and there are no any other options. Yes indeed if we can figure out what is the difference between the crappy library and the proper C# library (used by KingLuxor) then maybe we can fix it. But that requires some knowledge how windows and serial drivers and such work, which is beyond what I can do. There are currently 3 possible "workarounds" : Don't use windows 10 Disable handshake in config file, manually set COM port (currently suggested option) There are unconfirmed reports that some arduino copies with different USB-Serial chips work just fine for some reason I am very interested in fixing the windows 10 problem, many of us have tried for months. What I don't have any interest in is getting a new windows 10 computer just to find a fix.
  2. OK you have a few mistakes in the code: if(t |= 0) should be if(t != 0) and CPacket.MainControls |= (1 << n); should be CPacket.MainControls |= (1 << 0); because "n" does not exist anywhere in your code. I don't know why you are changing the bits manually and not using the simple function MainControls(RCS, HIGH); The reason why SAS and RCS only comes on after the for loop is because during your start sequence no packet is sent to KSP. Only after the sequence does normal communications start. Arduino can only do one thing at a time. You can fix this the proper way by doing what @Freshmeat is suggesting, or if you don't care about fixing it properly you can force a packet to be sent by using KSPBoardSendData(details(CPacket)); After your SAS and RCS checks. Really cool looking control panel though! I think target distance and speed are good suggestions. I will look into adding them after the 1.2 update shows up.
  3. In both of your for loops, you have the wrong syntax, the first one: for ( int i; i <= 15 ; i++) is wrong, you probably meant for ( int i = 0; i <= 15 ; i++) The second one: for (int t = 10; t = 0; t--) is also wrong, you probably meant for (int t = 10; t <= 0; t--)
  4. You can use good old look up tables for your trig functions like this: http://forum.arduino.cc/index.php/topic,69723.0.html You can also go all out and get a teensy 3 like @stibbons, which I think is 5V tolerant on digital pins. They are kickstarting a new one with a 180MHz ARM...
  5. Possibly, most of the things are meant to be easy to directly sent to a display with a simple dtostrf() which gives you a easy method to choose how to format the number. Floats are slow, but maybe not as slow as you might think: http://forum.arduino.cc/index.php?topic=40901.0 10 - 40us per operation, you can do 25000-100000 floating point calculations a second. So unless you are doing some serious maths it really shouldn't be a problem.
  6. A long while ago the author of the more action groups mod was looking into how we can hook into his plug in, but have not heard from him since so I have completely forgotten about it. The real question is why squad haven't increased the number of action groups? Anyway, considering how easy it is to emulate joystick and keyboard, options exist for people needing more action groups, I don't think it justifies the amount of work involved. You have to think about what happens for people not using the AGE plug in. Do we still keep the same packet format with the additional 250 inputs? Do we keep a separate format? About my policy of not officially supporting other mods, everyone have different ideas of what they want their system to do, some people want mechjeb integration, some people want KOS, I can't possibly support all the things. If you really must have it, you are more than welcome to fork the code like many people have have maintain your own version of the plug in.
  7. Yeah the CKAN version is windows only, because of the serial port library. I remember it being pretty easy to move to 1.1, only a few lines need to be changed, and adding a reference to a different .dll.
  8. Well, if you have a serial monitor, and you are seeing packets sent from KSP to the arduino, then there's nothing wrong with the plugin, there's something wrong with your arduino.
  9. Maybe you can try changing the refresh rate in the config file, by default it's 5 times a second (0.2). It sounds like there's something wrong on your arduino end since KSP is sending out packets just fine.
  10. You shouldn't need to do anything with the bits, if you want turn on say group 1 just use: ControlGroups(1, HIGH); The function is in demo13: void ControlGroups(byte n, boolean s) { if (s) CPacket.ControlGroup |= (1 << n); // forces nth bit of x to be 1. all other bits left alone. else CPacket.ControlGroup &= ~(1 << n); // forces nth bit of x to be 0. all other bits left alone. }
  11. Oh... The demo code is just a simple template for writing your own code. It has nothing for LCDs in it. If you want to use LCDs, you should first figure out how to use it, follow the arduino tutorials to print numbers and stuff. Then you can put the same code into the demo, change the print value to something useful (say VData.Alt). I would put it just below "Indicators();"
  12. Oh yeah it's unfortunately not possible to have the SAS on and still have axis control over the plugin. Either SAS is controlling the craft or you are. My code simply turns off SAS when your input > SAStol and gives you control. You can mess with the SAStol value and see what's comfortable for you. If you must have SAS on with your axis controls, you can use a leonardo for a proper USB HID joystick.
  13. " Access to the requested resource is not authorized " usually means something else is using the port, is your arduino IDE using it maybe?
  14. Why do you need to remove it? You can set it to zero or change the control input settings, see first post. For the LCD, just look up arduino LCD tutorials, it's pretty easy to hook up.
  15. What I always wondered is if there's a way to directly read the values from the UI.
  16. Well it's not difficult to add more SOI numbers if squad decides to have a planet/star DLC or something, the code is there for it. It's a simple look-up table, the reason for the star/planet/moon decimal system is just for human readability. We could just assign any value so 255 SOIs max with the byte. (Edit: 255 SOIs ought to be enough for anybody right? right? ) I won't be adding support for mod planets, but if you want to add your own it's pretty easy, just go to the GetSOINumber function. private byte GetSOINumber(string name) { byte SOI; switch (name.ToLower()) { case "sun": SOI = 100; break; case "moho": SOI = 110; break; case "eve": SOI = 120; break; case "gilly": SOI = 121; break; case "kerbin": SOI = 130; break; case "mun": SOI = 131; break; case "minmus": SOI = 132; break; case "duna": SOI = 140; break; case "ike": SOI = 141; break; case "dres": SOI = 150; break; case "jool": SOI = 160; break; case "laythe": SOI = 161; break; case "vall": SOI = 162; break; case "tylo": SOI = 163; break; case "bop": SOI = 164; break; case "pol": SOI = 165; break; case "eeloo": SOI = 170; break; default: SOI = 0; break; } return SOI; }
  17. That's amazing! I hope you can keep this updated as we add more stuff to the packet.
  18. Sure it's possible that a complicated autopilot will use too much time, but a simple PID controller should be fairly fast. In any case, I would suggest you start with something simple that works before planning more advanced stuff.
  19. I'm not working on it. You might need to ask @cm2227 how hard/easy it is. @Sputnix is working on adding the orbital vectors, so at some point you will be able to write a thing that points the ship to the right direction. There is enough information in the packet that It is already possible to make a autopilot for atmospheric flight.
  20. OK Thanks. But I just realised I still need windows 10 to do the tests, and I kind of don't want windows 10. If someone else is stuck with windows 10 I'll tell them to try those.
×
×
  • Create New...