Jump to content

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


zitronen

Recommended Posts

Ok that's helpful. So the plugin is not getting any input packets. Is your arduino tx LED on when you launch? Rx LED should flash every 80ms, tx led should flash every 25ms, so it looks like it's on solid.

Link to comment
Share on other sites

So the problem has something to do with the arduino code not actually sending anything to the plugin.

Yes... but the arduino code has no problem sending the data if chatterer is in the gamedata folder. So the problem has to be at the plugin side of things.... and some how the chatterer code holds the cure.

Link to comment
Share on other sites

Well, I can confirm Mulbin's issue partially. Buttons/switches do not effect any change and only the RX light is flashing.

Edit: Fully confirmed. TX only with chatterer mod installed, buttons and switches functional.

Edited by Chaosratt
Link to comment
Share on other sites

Well, I can confirm Mulbin's issue partially. Buttons/switches do not effect any change and only the RX light is flashing.

Edit: Fully confirmed. TX only with chatterer mod installed, buttons and switches functional.

I'm glad someone has replicated the bug! I thought I was going insane!

Link to comment
Share on other sites

It seems that the bootloader on the mega puts the micro controller into load program mode if you send serial data to it too soon after connecting, which causes the thing to lock up. I just added a delay.

Link to comment
Share on other sites

Version 0.15.0: Moar Outputs!

Added:

Mission time: (second) unsigned long, will overflow after 2^32 seconds or ~130 years, so if your mission is more than 130 years, you will have problems with time

delta time: (second) float, the KSP time difference between current and previous packet, should be correctly scaled by time warp.

Also added the following resources for current stage, they are based on what the engines can see, so you need to activate engines on the stage to see them. The code is copied from the KOS plugin.

float LiquidFuelTotS;

float LiquidFuelS;

float OxidizerTotS;

float OxidizerS;

Plugin:

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

Updated arduino code: (indicators now use stage fuel instead of total fuel)

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

Link to comment
Share on other sites

Your quick! And thank you for adding LF information status.

Version 0.15.0: Moar Outputs!

Added:

Mission time: (second) unsigned long, will overflow after 2^32 seconds or ~130 years, so if your mission is more than 130 years, you will have problems with time

delta time: (second) float, the KSP time difference between current and previous packet, should be correctly scaled by time warp.

Also added the following resources for current stage, they are based on what the engines can see, so you need to activate engines on the stage to see them. The code is copied from the KOS plugin.

float LiquidFuelTotS;

float LiquidFuelS;

float OxidizerTotS;

float OxidizerS;

Plugin:

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

Updated arduino code: (indicators now use stage fuel instead of total fuel)

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

Link to comment
Share on other sites

whoa... how did I miss this! I'll download the new update tonight! great news.

Any hints on how to code my charge/drain dial would be great if anyone has any ideas. The dial will have a needle show whether the battery is draining or charging and by how much.

The gauge will have a similar layout to this one, but obviously its actually a 0-5v voltmeter.

ammeter-clip-art.jpg

First I need code to determing how fast my electric charge is draining or charging measured against MET.

The needle will need to be pointing vertically up when the battery is neither charging or draining (so arduino sending signal of about 127-128) and will move towards the left when the battery is draining and to the right when it is charging.

So negative values (drain rate) will mean the pin sending a signal range of 0-127 (0 being the strongest amount of drain) and positive values (charge rate) will use a signal range of 128-255

Edited by Mulbin
Link to comment
Share on other sites

Sorry for the noob question but the arduino code is 4 different files and I do not know how to load them so it will compile and work on my uno. How do I go about opening and running this program?

EDIT: after re-downloading and opening from the KSPIODemo file all of the others where included.

Edited by thatsmessedup
Link to comment
Share on other sites

Iv wired my arduino up but no success. Iv installed the plugin to the gamedata folder then opened arduino uno r3 and sent the program KSPIODemo without a hickup. After launching ksp I go into vab and setup a simple rocket. I hit launch and the green led will flash for about 1 second before showing anything on the pad. When I go to launch my rocket there are no blinking tx/rx lights and I do not get anymore activity from the leds. Any ideas?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...