daid / daid/EmptyEpsilon

LUA Serial Communication

Open
#2,127 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
869
Forks
222
Avg merge
18h 33m
Merged PRs (30d)
1

Description

Hey all,

I'm trying to design some physical Repairable Ship Components that are basically Arduino's with some kind of sensor combination.

The idea is that within the Mission Script - something causes Shields or Beam Weapons etc to loose power, a Serial message (possibly a single char) is sent to the Arduino that is the "Shield Matrix" or "Beam Weapon Control Conduits".
The Arduino then requires fixing - when this is done the Arduino sends another Serial Char that is picked up by the Mission Script and puts Shields/Beams Power back to Full..

I'm having issues getting a Mission Script to successfully send a single Char over Serial..
I have tried the following methods (for Windows) in several places in the Mission Script:

   file = io.open("COM6","wb")

   io.output(file)

   io.write("B")

^ this one seems to allow the Script to load and I can see the Mission Assets in the Game Master screen but does not send anything over Serial (Arduino is configured to light up its built-in LED upon receiving the letter "B")

and

   Arduino_Com_Port = com.open("COM6", 115200, 0)

   com.write(Arduino_Com_Port, "B")

^ this one has issues with the 'Global com not being recognized'

any help would be greatly appreciated
Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Mission Script serial APIs shown in the issue, comparing the io.open/io.write attempt with the com.open/com.write attempt and the reported global-com error. Done means a Mission Script can send the character "B" to the Arduino and receive a response that restores the relevant system power.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, lua
Domain
embedded-iot, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.