Re: interfacing Euphoria to the 'real' world

new topic     » goto parent     » topic index » view thread      » older message » newer message

I'm sure this isn't the answer you want to hear, but "it depends". Anything you plug into your computer is going to be registered at the O/S level first. If you want to use Euphoria to create a driver for your device, I would suggest that perhaps Euphoria isn't the best tool for the job, though I'm sure it's doable, and that whatever library you're looking for probably doesn't exist.

Let's look for a moment at the many different types of devices that currently plug into a computer via USB. Some will present themselves as a mapped device port with a corresponding file handle, such as "COM3:". If the O/S treats your device like a serial port, there are a number of very good libraries for working with them, though I'm sure many have not been updated in a number of years. If the O/S treats it like a HID, sound card, or disk drive; you can use the standard win32lib (or whatever GUI lib) routines for that device as if it were hardwired into your computer.

Many devices are wireless ethernet enabled, so you can create your own TCP or UDP protocol and use the sockets library to communicate with the device over the existing network infrastructure. Some devices already have a built in web browser, so it would be even simpler, just needing to interact with the existing pages over TCP port 80.

The last thing to look at would be either an Arduino or RaspPi that is connected via USB. I don't know much about the RaspPi other than it is a standalone computer running Linux. The Arduino presents itself as a serial port to the computer, so you can read and write data to it via the various serial port libraries. The only thing lacking is direct pin control, so you would have to install a program on the Arduino itself (typically using their "Processing" language) that interprets the serial commands and controls the pins that way.

I know this is a complicated answer to a simple question, and I hope I've answered it to some extent.

Mike Sabal

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu