Re: interfacing Euphoria to the 'real' world
- Posted by ryanj Dec 28, 2013
- 2805 views
Is there a complete working lib yet to allow Euphoria code to send and recieve signals from the "real world"? Possibly using the usb port?
useless
I wrote a wrapper for FTDI USB UART devices (ftdi_D2XX.e) for Windows. FTDI does have drivers for multiple platforms, including Raspberry Pi.
- http://www.ftdichip.com/Drivers/D2XX.htm
- http://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer%27s_Guide%28FT_000071%29.pdf
Some products that I have been using:
- http://www.ftdichip.com/Products/ICs/FT232R.htm
- http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm (I really like the TTL-232RG-VREG3V3-WE cable)
I am currently using the FTDI devices to let Euphoria programs communicate with hardware based on the Propeller chip, as well as XBee radio transceivers. Detecting specific USB devices works well, without even using numbered com ports. To explain, "Virtual COM port (VCP) drivers cause the USB device to appear as an additional COM port available to the PC. Application software can access the USB device in the same way as it would access a standard COM port." I don't use that method, because COM port numbers get confusing and it adds an unnecessary layer. I use D2XX instead. "D2XX drivers allow direct access to the USB device through a DLL." It still operates as a serial port. Once you identify the device, you open it, set the baud rate, set flow control, turn DTR/RTS on or off as you wish, etc.
It works without blocking and plays nicely with multitasking. I just haven't released it yet because i need to create an example program and write some documentation. I'll try to get that done soon.