I was wondering how much bother would it be to add some sort of support for communication through serial ports to love? I want to use love to do stuff with my machines, right now I use processing but I really like lua. I feel like this functionality would open up a lot more options and make love more useful to artists and inventors.
Any thoughts? Am I being silly? Do I just need a simple to use library? Can I write my own in lua using love as it is now??
Serial ports?
Re: Serial ports?
You can import native lua libraries in love, see this thread for reference: viewtopic.php?f=5&t=2076SPlice wrote:I was wondering how much bother would it be to add some sort of support for communication through serial ports to love? I want to use love to do stuff with my machines, right now I use processing but I really like lua. I feel like this functionality would open up a lot more options and make love more useful to artists and inventors.
Any thoughts? Am I being silly? Do I just need a simple to use library? Can I write my own in lua using love as it is now??
I am 99% sure there is a lua library for serial ports.
Edit: or just use lua's fileio: http://stackoverflow.com/questions/2520 ... ort-in-lua
- soulaymenc
- Prole
- Posts: 36
- Joined: Thu Jul 11, 2013 2:03 pm
- Contact:
Re: Serial ports?
I made a love app that communicates with an arduino using serial port on linux, it's pretty easy, as on linux a serial port is nothing more but a file (FILE *) you just open it in both read and write mode.
This world is so strange.
Re: Serial ports?
So I decided the best option would be to use lua's built in io stuff as I don't want to have to compile my own version of love for the project, now I need to figure out if I can get to the com ports on windows 7 as simply as people seem to be able to on linux
Edit: and it seems that would be a no... I suppose I should really be running linux but I could prob also figure a way to send the data from the serial port to localhost and use luasocket.... it would sure be nice if love had its own built in serial library
Edit: and it seems that would be a no... I suppose I should really be running linux but I could prob also figure a way to send the data from the serial port to localhost and use luasocket.... it would sure be nice if love had its own built in serial library
Re: Serial ports?
Why a no? Windows Serial Ports are "COM" ports; you can open them like files too, their names are just "COM1", "COM2" etc.SPlice wrote:So I decided the best option would be to use lua's built in io stuff as I don't want to have to compile my own version of love for the project, now I need to figure out if I can get to the com ports on windows 7 as simply as people seem to be able to on linux
Edit: and it seems that would be a no... I suppose I should really be running linux but I could prob also figure a way to send the data from the serial port to localhost and use luasocket.... it would sure be nice if love had its own built in serial library
http://lua-users.org/wiki/SerialCommunication
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Serial ports?
I did something a little bit... ugly to get access to COM ports, since none of the options seemed to work for me and I had a deadline.
I coded an app in C# to gain access to the SerialPorts API in .NET framework, and made a TCP server to control it. In Lua I created a TCP client that connects to that server and with simple commands I'm able to control how the port is configured and the data that goes in and out of the port.
You can check it out in the projects page http://www.github.com/Positive07/Risem. It's rather UGLY but it worked for me
I coded an app in C# to gain access to the SerialPorts API in .NET framework, and made a TCP server to control it. In Lua I created a TCP client that connects to that server and with simple commands I'm able to control how the port is configured and the data that goes in and out of the port.
You can check it out in the projects page http://www.github.com/Positive07/Risem. It's rather UGLY but it worked for me
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Who is online
Users browsing this forum: No registered users and 5 guests