Jump to content

midnitemax

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by midnitemax

  1. So, I've run into this problem again (controller becoming unresponsive) and now it happens right away when I want to send a translation message. Here's my code: #include <KerbalSimpit.h> #include <PayloadStructs.h> #include <DebounceInput.h> #define forwardPin 51 #define backwardPin 50 #define rightPin 52 #define leftPin 53 #define upPin 48 #define downPin 49 #define stagePin 26 int lastUpdte = 0; int updateDelay = 125; DebouncedInput displaySelect(4); DebouncedInput forward(forwardPin); DebouncedInput backward(backwardPin); DebouncedInput right(rightPin); DebouncedInput left(leftPin); DebouncedInput up(upPin); DebouncedInput down(downPin); DebouncedInput stage(stagePin); KerbalSimpit mySimpit(Serial); void setup() { Serial.begin(115200); while (!mySimpit.init()); } void loop() { mySimpit.update(); stage.read(); if (stage.falling()) { mySimpit.activateAction(STAGE_ACTION); } translation(); } void translation() { translationMessage translationMsg; translationMsg.mask=1|2|4; forward.read(); backward.read(); right.read(); left.read(); up.read(); down.read(); if (forward.falling() || forward.low()) { translationMsg.X = 32767; } if (backward.falling() || backward.low()) { translationMsg.X = -32767; } if (right.falling() || right.low()) { translationMsg.Y = 32767; } if (left.falling() || left.low()) { translationMsg.Y = -32767; } if (up.falling() || up.low()) { translationMsg.Z = 32767; } if (down.falling() || down.low()) { translationMsg.Z = -32767; } mySimpit.send(TRANSLATION_MESSAGE,translationMsg); } If I comment out the translation(); it works fine (well, all it really does then is staging). But if I leave it in, the staging doesn't work either, indicating to me, that something somewhere has crashed.
  2. Just wanted to chime in on this discussion, because I have similar problems. It doesn't seem like the serial buffer filling up is the issue. I followed your other advice though and that solved the problem (at least this one ).
  3. Well, at least in "my" Demo10 this is what the head looks like #include <SPI.h> #include <Wire.h> //#include <Adafruit_GFX.h> //#include <Adafruit_SSD1306.h> #include <u8glib.h> #include <pgfx.h> #include <MemoryFree.h> So I need to comment out everything that has to do with the display, but that doesn't really matter anyway since I'm far from hooking up a display, anyway.
  4. Not sure what you're trying to say with "did I come right" :-/ anyway, it's just not working anymore. My test setup right now consists of the Arduino with a push button on the SAS pin defined in Demo10. Also, I just downloaded everything new and commented out all the display stuff in Demo10 so it would compile. Right now I'm testing on KSP 1.0 and it's not even saying "No display found" anymore, but I still have a couple of old versions of KSP lying around if that might be the problem, but it was even on 0.90. Thanks for the help, by the way, and thanks for an awesome mod (even if it's not working for me right now) @agent_0004: how's it working for you, you seem to be a newbie to this, too, no disrespect :-)
  5. I didn't have any time/motivation to do anything regarding this the last couple of months and for some reason now it's not working anymore :-/ It seems to connect OK when I load a vessel but it's not reacting to any inputs from the Arduino nor are there any outputs. Anyone got an idea what this could be?
  6. Finally got around to testing it. The demo works great so far, except that all my buttons and LEDs are not set up properly :-p I'm really looking forward to a lazy, soldery, programmy Sunday. Thanks K!
  7. That's a pretty good idea, but I think for now marzubus made the race so, I think I'm going to play around with that before I continue my approach.
  8. OK, I made some progress. The road I'm taking is using Firmata on the Arduino to control the Arduino using Processing and then communicating with KSP via oscP5... which is where I got stuck. Might have something to do with me being a noob at this or maybe with all the alcohol I had last night, but I can't seem to find out how to make a plugin for KSP that is able to communicate with Processing over oscP5. Can anyone give me a push in the right direction?
  9. I actually got that far but still no luck. Like I said, it dies on [KSPAddon(KSPAddon.Startup.EditorAny, false)] - - - Updated - - - Nevermind, I mucked it up. Gots it to work :-) - - - Updated - - - Except that it wont build :-/ I feel really stupid for asking this question, but how do I build a dll (with Xamarin). It keeps trying to build an exe which doesn't work because there's no main method. I can understand that that would be a problem but that's not what I want to do. - - - Updated - - - Again, nevermind :-p
  10. So, this post seems dead, but maybe somebody can still help me. All this doesn't work for me :-p I'm using Xamarin Studio on Mac and when I want to build the code the first error comes up on [KSPAddon(KSPAddon.Startup.EditorAny, false)] Also I'm guessing I have to inlude libraries or references or something (sorry I'm new to C#) Thanks for the help
  11. I'm also really interested in seeing this working. Unfortunately I'm a knowledgable amateur at all this at best. Could it be possible to somehow salvage the Arduino IDE code? (Probs not since it's not C#) Something else that might be interesting is this but I have no idea if or how that could help us here. Looks like this guy got it to work, unfortunately he want's money for it...
  12. Oh wow, there's a lot of discussion going on in that department. Since I basically have no experience in using something like microcontrollers I haven't ever heard of Arduino and never found that thread :-p While looking around how I can do this I found about the Teensy (https://www.pjrc.com/teensy/) which is what I'll be using. It seems to be mostly compatible with software written for Arduino, so that is propably really helpful. Mainly this project is meant as an access to a new hobby, since I wanted to learn about all that stuff but I'm definitely starting at the beginning :-)
  13. Ah, ok cool. I was searching for the wrong terms. This helps a lot, thanks Redjoker! midnitemax
  14. Hey everybody, I have a question regarding a project I am about to undertake. I'm trying to build a alternative input device for KSP, basically a keyboard of sorts specifically designed for KSP. For instance I want to use switches to activate action groups (and a shielded switch for the abort action group ) and fun .... like that. I have ordered some parts to play around first as I have some expierence in electronics and programing but have to figure out how exactly I have to go about this first, so I'm still very much in the preliminary stages of the whole project. Yet I have already encounterd a problem I wont be able to solve on my own: in my eyes the whole thing would be pointless if I wouldn't use a sliding potentiometer for throttle control (actually I want to use a motorized fader as they are used in sound boards so I can still use other inputs as well to control the throttle (at this point I would like to request a drooling kerbal smiley for the forum )). Using the Teensy as a controller the intepretation of the signal from the potentiometer shouldn't be a problem but I don't know how I can use that value for the throttle. So far I haven't found out if the game can use controls for the throttle other than shift, control, x and z. Is that really all or am I missing something? If not, does anyone have an idea how this can be achieved? Thanks in advance. midnitemax
  15. I'm guessing "Whackjob" is the name of a person and I don't know if he did it, but here's _a_ whackjob doing it: Check out the other Robbaz-KSP vids, if you don't know him, especially #2 of the pet asteroid series in which he retrieves the asteroid (named "Charlie" or "Sharlie" in his pronounciation) from it's crash site to the KSC in 4 attempts, each one funnier than the last. IMO the funniest youtuber ever and the reason I got into KSP in the first place.
  16. So, here's the current version of my launch and orbit script: https://www.dropbox.com/s/jmisjtukd62y3le/testr.txt?dl=0 The stuff that has been commented out is currently undergoing work or isn't needed. The apoapsis is hard coded to 100 km at the Moment due to the way the gravity turn works right now. With the thrust limiter and gravity turn based on the TWR (or rather the mass to thrust Ratio at Launch) the Delta v for getting into Orbit should be around 4500 for any ship. I'd love to hear some comments on it
  17. Or just advise users to use our solution. It works exactly as it should (except if you have another shared folder called archive in your dropbox that you delete or rename but not unshare, then you might end up with an archive full of pictures :-) ).
  18. I just love the fact, that I can actually code a script for launching any ship into orbit with this mod. I can see the real world feel but by calculating the Isp based on every engines single Isp feels real enough to me. After all the engine could comunicate it's own Isp with the ships Computer but the Computer can't calculate it on it's own and I have to write a script for that What I'm trying to say is: I love this mod!! (sorry if I capitalize words every once in a while, it's the German auto correct on my Computer at work and sometimes it just doesn't let me undo an auto correct. Also, if I have some spelling Errors, it's because it's telling me almost every word I write in English is wrong and I basically have red squiggly lines under all words. I also can't change this, because I'm forced to use some old version of IE, that totally sucks and if there is an Option to turn off auto correct I simply can't find it )
  19. We've actually (after hours and hours of coding and actually not that many lines of code in the end) managed to make a automated launch and orbit script. Since both of us are fans of physics rather than pros there was a lot of trial and error involved (my favorite error: for mu (Standard gravitational parameter) instead of G*M we used g*r and even though this is complete nonsense the calculated burn time wasn't that far off :-) ). Not for the actual paramteres but for the calculations needed for the parameters, so for the most part the script is independent of the ship (for now staging occurs whenever 720 liquid fuel is used up). I actually think it's a quite nice piece of work, especially because it doesn't use maneuver nodes at all but rather it calculates delta-v at apoapsis needed for circularization, then burn time and then starts burning at burn time/2 before apoapsis. It also includes a thrust limiter (based on the TWR (or rahter the TMR, because I couldn't find the TWR :-) )) for the initial ascent limiting the velocity to 95% terminal velocity and a gravity turn based on a somewhat swashbuckling (what a nice word ) calculation BUT it works quite nice. I'm at work right now, so I can't post the code (also it's not yet completely done, like I said, the staging needs to be modified and I worked on the gravity burn until 2 am last night so I did not yet implement the Isp calculation) but here's a screenshot of an achieved orbit (you can tell the script what you want your orbit to be, 100000m was the input in this case, it tends to overshoot because it stops bruning at apoapsis > input): https://www.dropbox.com/s/dpqfu69v29n1jg1/Screen%20Shot%202014-09-16%20at%201.59.45%20AM.png?dl=0 Note the burn time for orbital Insertion burn is shown in the terminal. This was the only burn and it was 100% throttle to up + r(0,-90,180). This was not my "cheapest" attempt, it took 4489m/s^2 to get into orbit. My best attempt so far was 4485m/s^2 (I'm not sure if I calculated that correctly: delta v in vacuum before launch - delta v in vacuum after orbital Insertion. Makes sense, right?). Also I'm not sure if the way the gravity turn is calculated works as good for other ships or higher (or lower) orbits. One more question: we just started using kOS when my friend was visiting, now we're a couple of hundred miles apart again but still coding like crazy. Is it possible to set the archive to a dropbox-Folder? That would be great for sharing. EDIT: we found a way: http://www.dropboxwiki.com/tips-and-tricks/sync-other-folders just sync the Archive Folder with your dropbox using a third Party tool.
  20. Thanks, that should work. Up until now we used declare parameter isp. and basically just told the program what the Isp is which also worked fine for calculating burn time, but of course it's a lot more elegant to let the program figure it out :-)
×
×
  • Create New...