Programming IO
Hi, I have a question about outputting to ports on a computer, meaning sending information out through a parallel/serial/usb port, with a language like say c++. I thought that I had heard somewhere that it's as simple as outputting to a certain file and the OS takes care of the rest. Is that true, and if not, how would one do that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
SB 3:16
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
SB 3:16
Comments
2) The details depend on the OS and the particular version of C++ or whatever programming language you're using. You need to consult the documentation for your compiler and OS. With Linux for example, the serial ports are devices just like disks and you'd open a file using the name of the serial port and read and write to the opened file. Since the Mac OS is based on Unix, its serial ports work the same way. Windows is somewhat different depending on the compiler and run-time library.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
SB 3:16
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
SB 3:16