Shop OBEX P1 Docs P2 Docs Learn Events
Programming IO — Parallax Forums

Programming IO

SB316SB316 Posts: 33
edited 2010-06-12 20:25 in Robotics
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-01 03:13
    1) This really isn't an appropriate topic for Parallax's Robotics forum. You could post questions like this in the Sandbox forum though.

    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.
  • SB316SB316 Posts: 33
    edited 2010-06-12 14:08
    Thanks, do you know how to find out what the files are?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    SB 3:16
  • FranklinFranklin Posts: 4,747
    edited 2010-06-12 19:06
    Somebody said...
    Thanks, do you know how to find out what the files are?
    The files will depend on what language and compiler you are using as each has it's own and the are different with each compiler so you need to "read the manual"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SB316SB316 Posts: 33
    edited 2010-06-12 20:25
    Is the compiler the same as the IDE? I use XCode for most of my work so what "manual" should I read for that?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    SB 3:16
Sign In or Register to comment.