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.
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!
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.
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)