Jump to content

[Hardware, Plugin] Arduino based physical display + serial port io+ tutorial (24-11-19)


Recommended Posts

EVA control isn't impossible, but it isn't exposed the same way other fly by wire stuff is and looks pretty daunting to be honest.

I'm not even sure having a switch panel for EVA even makes sense. Further down the road on my cockpit build I always though it would be nice to have an airlock with an oculus rift inside :)

Link to post
Share on other sites

Replace the example numbers in the sketch with flight data :)

Badly typed example:

void loop()

{

input();

output();

printNumLED(0, (long)(VData.Alt/100), ' ',2);//will print the altimeter with 2 decimal places (i.e. 12345.67 metres)

printNumLED(0, (long)(VData.AP/1000), 'A',3);//will print the apoapsis as kilometers, with 3 dp (i.e. 'A 96.321' km)

}//end loop

//note: adding things into mainloop is not the best, but makes for quick examples.

Link to post
Share on other sites
Adding wheel control is pretty straightforward. I've got the changes sitting in my fork now, but probably won't have time to test it properly and send another pull request until the end of the week. If you're keen, https://github.com/phardy/KSPSerialIO/tree/wheelcontrol

EVA control isn't impossible, but it isn't exposed the same way other fly by wire stuff is and looks pretty daunting to be honest.

All right I'm back. Stibbons, before you do any more pull requests, I'm planning on moving to the new autopilot/fly by wire thing added in 0.90. (see http://forum.kerbalspaceprogram.com/threads/103152-What-s-new-in-0-90) I was thinking about redoing the controls stuff completely on the plugin side, but I haven't had a look at how easy/hard it will be yet. Will you be willing to have a look at that?

Link to post
Share on other sites
Replace the example numbers in the sketch with flight data :)

Badly typed example:

void loop()

{

input();

output();

printNumLED(0, (long)(VData.Alt/100), ' ',2);//will print the altimeter with 2 decimal places (i.e. 12345.67 metres)

printNumLED(0, (long)(VData.AP/1000), 'A',3);//will print the apoapsis as kilometers, with 3 dp (i.e. 'A 96.321' km)

}//end loop

//note: adding things into mainloop is not the best, but makes for quick examples.

Even more progress! But still not completely there... I couldn't get it to say anything other than 0.00 for my alt on a craft already in orbit. When I launched a new craft (stock install) it got to 100 meters and said 0.01 Then it did nothing for a while and then said 0.35... then it just stayed there. Is it possible I need to add something to keep it in sync with the plugin?

EDIT - Ignore me, I had changed the chipsel pin in one line but not another. IT WORKS!!!!! Woooottt!!!!

Thanks so much, I can get back on track now :)

- - - Updated - - -

Now... on to my next quesion! I can now display whole decimal numbers which covers most readouts, but I still need to work out how to display time. This will not only need two separate decimal points illuminated but will also need to work in blocks of 24 hours, 60 minutes and 60 seconds, something like the 12.35.15 (12 hours, 35 minutes and 15 seconds). Is this possible on a single 7 segment module? Or do I need to display them separately on 3 different 2 digit displays and mount them together on my panel?

It would also be very nice to get a characters on the spare digits, so time to AP might look like... A 03.13.56 or time to PE as P 12.45.06

Edited by Mulbin
Link to post
Share on other sites
I was thinking about redoing the controls stuff completely on the plugin side, but I haven't had a look at how easy/hard it will be yet.

Oh, the new autopilot callback registers look pretty cool. And if it works the way that thread describes then it would make this plugin config a lot simpler (and I can throw away that last PR :) ). Sure, I can probably knock up a prototype for that in the next couple of days.

Link to post
Share on other sites
Now... on to my next quesion! I can now display whole decimal numbers which covers most readouts, but I still need to work out how to display time. This will not only need two separate decimal points illuminated but will also need to work in blocks of 24 hours, 60 minutes and 60 seconds, something like the 12.35.15 (12 hours, 35 minutes and 15 seconds). Is this possible on a single 7 segment module? Or do I need to display them separately on 3 different 2 digit displays and mount them together on my panel?

It would also be very nice to get a characters on the spare digits, so time to AP might look like... A 03.13.56 or time to PE as P 12.45.06

Doh, that only works for 1 day! So I guess I actually need more than 8 digits for days, hours, minutes and seconds if I fly for more than 99 days. 187.15.34.12 (187 days, 15 hours, 34 minutes and 12 seconds) so probably 10 digits to allow up to 9999 days. I might see if I can get 1x4 and 3x2 digit modules to daisy chain, which will make the arduino code a little easier as I can have different maths for each section (24 hours...60 minutes etc).

Link to post
Share on other sites
Oh, the new autopilot callback registers look pretty cool. And if it works the way that thread describes then it would make this plugin config a lot simpler (and I can throw away that last PR :) ). Sure, I can probably knock up a prototype for that in the next couple of days.

Awesome! In the mean time I will look at sending back control status stuff (RCS, SAS, etc.).

Link to post
Share on other sites

the line near the start of the sketch that says

LedControl lc=LedControl(LEDDatain,LEDClkPin,LEDChipSel,1);//1==num of 8x8pixel arrays in line. can be up to 8.

Change the 1 to any number up to 8. The Dout line on the module connects to the next Din, and the other connectors pass through.

If you have trouble with daisy-chaining modules, you may need to look up KK4TEE's fix on my thread :)

Edited by AmeliaEatyaheart
Link to post
Share on other sites

This branch has everything I've done on the plugin to date: the configuration changes to keep the plugin from stomping on keyboard input, using the new autopilot handlers, and extensions to the control packet for rover control: https://github.com/phardy/KSPSerialIO/tree/new-autopilot

Most of it is working fine, but I'm not able to get the wheels working yet. Hoping I've just done something dumb. :) Doing some more testing on it now, hoping to have it finished tonight. After that, I was going to take the liberty of updating the arduino demo code for the new control packet and adding it to the repository as well.

EDIT: Turns out the wheels weren't working because I hadn't turned them on in the config file. :blush:

Edited by stibbons
Link to post
Share on other sites

Question: Has anyone here tried printing the labels including the background color for the whole panel in the form of a giant sticker?

Printing services exist, it's not that expensive, weather-proof variants are available (sweat and all that) and it might look much better than those laser-printed decals that are available, hence the question

Link to post
Share on other sites
Question: Has anyone here tried printing the labels including the background color for the whole panel in the form of a giant sticker?

Printing services exist, it's not that expensive, weather-proof variants are available (sweat and all that) and it might look much better than those laser-printed decals that are available, hence the question

I considered this, but in the end decided just to get the whole thing, including the background colour printed straight on to aluminium composite.

EDIT - I've ordered my first panel, will wait and see how it looks!

Link to post
Share on other sites
This branch has everything I've done on the plugin to date: the configuration changes to keep the plugin from stomping on keyboard input, using the new autopilot handlers, and extensions to the control packet for rover control: https://github.com/phardy/KSPSerialIO/tree/new-autopilot

Most of it is working fine, but I'm not able to get the wheels working yet. Hoping I've just done something dumb. :) Doing some more testing on it now, hoping to have it finished tonight. After that, I was going to take the liberty of updating the arduino demo code for the new control packet and adding it to the repository as well.

EDIT: Turns out the wheels weren't working because I hadn't turned them on in the config file. :blush:

Nice! Right now I'm kind of in between versions, everything is messy. Once I get a working version I will look into integrating your code. I'll probably just do it manually...

Link to post
Share on other sites

Not so weekly "Weekly" update

Changed: Plugin version 0.17 (not full release yet)

  1. Added sending back of control statuses in a single uint16: SAS, RCS, Light, Gear, Brakes, Abort, Custom01 - 10
  2. Added simple function in arduino for reading the statuses
  3. SAS and RCS controls are now synced when switching vessel (Freshmeat request)
  4. Added return value for input() function in arduino code (MrOnak post #705)

Data structure has changed, you will need to change your code for compatibility. If you are not in a hurry to get the new functionality, I suggest waiting till the next version with the new control stuff. This is mostly an update to help stibbons with code integration. GitHub code should now be up to date, sorry about that.

Plugin:

https://sites.google.com/site/zitronfiles/KSPSerialIO_017.zip

Arduino Code:

https://sites.google.com/site/zitronfiles/KSPIODemo9.zip

Link to post
Share on other sites

Hi,

Im just dropping in to say I have done a Mac version of KSPSerialIO which can talk directly over serial to the Arduino. Leaving it here for those who are interested: https://github.com/unixunion/KSPSerialIO

There are binaries in the release subdir if you don't feel like compiling. If you want to build it you need my serial library too: https://github.com/unixunion/PsimaxSerial

Testers welcome!

Link to post
Share on other sites

So, is it possible to make Arduino control camera when in IVA view?

I was going to write my own IMU code for a spare quadrocopter controller I have laying around, as a university project. I might as well make it into a headtracker. I have headplay 800x600 video goggles I generally use for flying my copters and planes via live video feed, would be nice to fly all-iva missions with this level of immersion. :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...