Jump to content

midnitemax

Members
  • Posts

    24
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Bottle Rocketeer
  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
×
×
  • Create New...