C++ io PORT hints

This is a discussion on C++ io PORT hints within the C++ Programming forums, part of the General Programming Boards category; I am working on a small robotics project, and I am pretty much fermillier with C++, and have written a ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    3

    Question C++ io PORT hints

    I am working on a small robotics project, and I am pretty much fermillier with C++, and have written a couple of short programs. For my robot I am choseing to use c++ for programing the computer, and not basic. I have not goten information about sending data to and from the parrallel port.

    I DO understand data flow, and variables and that sort of stuff, I only need help with the in/out commands.

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    3
    The compiler I am useing is MS Visiual C++ Standard Edition v4. I am planning on running this under win 95, in my robot.

  3. #3
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I think you can open the ports with fstream and do it. I know you can for LPT and COM ports.

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    3
    I figured out how to send data to the port useing the code:

    cout >> "decmal");
    cin << dec;
    _outp(0x378, dec);

    this had worked out well, and I can sent any binary to the port: I used it with a electronics kit to sent 5v to the breadboard. I wrote a motor control program like this.

    I still can't figure out eh input

    I tried this:

    _inp (0x378, strobe)

    but the compiler says there is strobe is not defined as a variable, but it not used as one.

  5. #5
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I don't understand how you get the code to actually move stuff in the robot. If you could give me a URL for this kind of stuff. I've always been interested in it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port IO ops not working properly
    By microtechno in forum Linux Programming
    Replies: 16
    Last Post: 06-08-2009, 01:33 PM
  2. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 02:58 PM
  3. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 06:49 PM
  4. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 04:28 AM
  5. Serial port read..can someone tell me..
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 06-27-2002, 09:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21