Hi all,
im doing a uni project and ive run into a little trouble

im writing a program in cpp (has to be cpp because of other constraints)
this program will get values from a file and depending on the values, send a high or low signal to the corresponding output pin on a serial port

i have done some research, but i cant get a solid answer on how to write from a program to a specific pin on a serial port

all i know is that i have to specify the com port (com1 or com2 etc) and the pin

any help on this would be MUCH appreciated

thanks

EDIT: im using windows xp pro, if that helps.

Recommended Answers

All 3 Replies

> EDIT: im using windows xp pro, if that helps.
But which compiler?
Not some fossil like TurboC by any chance?

> send a high or low signal to the corresponding output pin on a serial port
Er, you do know what a serial port looks like right?
Or even how a serial port works?
http://www.lammertbies.nl/comm/cable/RS-232.html
The only output pins which have a level associated with them are CTS and RTS.

> EDIT: im using windows xp pro, if that helps.
But which compiler?
Not some fossil like TurboC by any chance?

> send a high or low signal to the corresponding output pin on a serial port
Er, you do know what a serial port looks like right?
Or even how a serial port works?
http://www.lammertbies.nl/comm/cable/RS-232.html
The only output pins which have a level associated with them are CTS and RTS.

Why are you providing this information. I can't imagine someone trying to work with serial ports if they don't know the first thing about them.

Thats about as bad as if i was to set out writing a driver program in assembly for a microcontroller to interact with a keyboard. And then not looking at how the keyboard transmitts and recievers data.

That was a fun project btw, i also did it using shift registers aswell as assembly. I'm a bit of an electornics geek too :P

Chris

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.