Outputs

This is a discussion on Outputs within the C++ Programming forums, part of the General Programming Boards category; I was wondering how to send output through say a serial port using C++. alls I want to send is ...

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

    Outputs

    I was wondering how to send output through say a serial port using C++. alls I want to send is a basic on or off signal. I am making a device that uses a computer to ask a password and sends the on output through the serial port to lets say a lightbulb if the password is correct.
    Jeff Paddon
    Undergraduate Research Assistant
    Physics Department
    St. Francis Xavier University

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Not an answer...

    Sorry. I don't have the real answer, but I have some thoughts.

    First, this is going to be system-compiler specific. It's NOT portable ANSI C++. That's probably why you haven't run-across any information about it.

    You might be able to do it with a system call, or you might need to use assembly language.

    If you don't get a better answer here (unlikely!) you might try looking into how to write drivers. You don't need to write a complete driver, but drivers have to access the hardware!

    You might consider using the parallel port. The parallel port on a PC has 8 lines that can be written to (somehow?) and they will remain in the same state until written to again. The serial port is going to output pulses (serial data).

    Yeah, I've wondered about this before too, and I'd like to know how to go about it!

  3. #3
    UNBANNED OneStiffRod's Avatar
    Join Date
    Jan 2002
    Posts
    669
    Go to http://msdn.microsoft.com

    and search for ASPI

    That appears to be an API that allows you to have acess to the devices on the bus in the system.

    Later.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  4. #4
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    hop thyself over to www.beyondlogic.org

    the programming side of it, imo, is simple compared to the electrical engineering part (a relay and whatnot or whatever for what you're trying to control)
    hello, internet!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 03-05-2009, 11:32 AM
  2. Replies: 8
    Last Post: 09-11-2006, 12:26 PM
  3. assigning rand outputs to variables
    By 2fastwrx in forum C++ Programming
    Replies: 8
    Last Post: 09-27-2004, 11:17 PM
  4. strings and outputs
    By Mule in forum C++ Programming
    Replies: 3
    Last Post: 03-02-2003, 05:39 PM
  5. Replies: 3
    Last Post: 03-31-2002, 11:03 AM

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