Go to Post And then you realize...If you hadn't been working ALONGSIDE those engineers... you'd never have that other person to say, "Well, why don't you do this, so that it works?" - Nikhil Bajaj [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Spotlight this post!  
Unread 21-01-2003, 12:49
Ryan Meador Ryan Meador is offline
Registered User
#0190
Team Role: Electrical
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Worcester, NH
Posts: 68
Ryan Meador will become famous soon enough
I've used my serial port to communicate with my Stamp- and PIC-controlled minions many times. The code in C++ is very easy. It's treated as a file. Just open "COMX" as the file and set a few permissions (where X is the port number)... its all in the MSDN serial communication sample program.

hPort = CreateFile ("COM4", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

Then you'll want to look up the DCB structure to set all the cool baud rate, parity, and stop bit options. The COMMTIMEOUTS struct might help you out too. I've got a program that uses my serial port to send data (via my very own cobbled-together RS-232 radio transmitter) to one of my PIC robots. PM me and I'll send you the code.
__________________
-Ryan

"You're not a real programmer until you end all your sentences with semicolons;"
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to communicate both through radio and serial port? JC Denton Programming 1 08-02-2003 23:43
Ever seen this serial port problem before??? Aidan F. Browne Programming 5 05-02-2003 12:03
organized way of communication with FIRST? archiver 2001 0 24-06-2002 04:20
Serial Port Communication White Paper rbayer Programming 87 14-06-2002 16:10
serial communication using c++ Malakili Programming 31 01-05-2002 15:51


All times are GMT -5. The time now is 17:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi