Question:
Can i send information out of the USB port on my computer?
Sir.SquidingtonII
2012-08-24 16:16:09 UTC
I own a macbook, and i am a begginer in programming with the programming language 'Lua'. I am also working on building a robot, which i wish to hook up to my program on my computer. On the side of my laptop is a USB port, and i was wondering if i could send information from my lua program directly out of it. For example, if a variable in my program is '1', then it sends a small current out of a certain electrode in the USB port. And if it took input in from a different electrode it woild store either 1 or 0 in a different variable.
Is there any way of doing this? If so, are there any items available to plug into the USB port and have wires from each electrode? And would it do my computer any damage if there was input from one of the electrodes? And finally, how does a mac cope with the USB input, like how does it detect the usb is in, and where does it send information from the USB port? I am ok at electricity so if there is a problem with my idea i will probably be able to fix it.
I look forward to any replies!
Three answers:
tbshmkr
2012-08-24 17:44:19 UTC
Not it the way you are describing.

=

A book about Serial Port Communications.

Serial Port Complete - covers COM ports, USB virtual COM ports, and ports for embedded systems.

- http://www.lvr.com/serport.htm
husoski
2012-08-25 00:18:24 UTC
One problem with unconventional use of ports on modern computers is the OS. A modern OS, like OSX, Linux or Windows, goes to a lot of trouble to make sure that programs don't get access to I/O devices... either accidentally or maliciously.



Now, back in the "bad ol' days" of MS-DOS (or CP/M before it!), this was easier.



Your best be might be a hobbyist kit, like the servo controller here:

http://www.pololu.com/catalog/product/1352



Unfortunately, the configuration software for that only runs under Linux or WIndows. The configured device can run with OS X Lion as a plain serial port, though. Find the user's manual and check it out before buying.
2012-08-24 23:21:54 UTC
that is NOT how USB or any other serial data port works. It needs to send data streams, and both sending and receiving machines need to understand the stream format. In stead of learning a junk programming language learn a serious one, then maybe you would understand programming and IO control.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...