OCCRA
Go to Post I volunteered to be the person responsible for the electronics and raised my hand before realizing that I have had almost no electronics experience. I hope our robot turns out alright... - Blue_Mist [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-20-2003, 06:33 PM
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
Serial Communication in C++

I'm having trouble finding resources on serial communication with c++ for the 3d dashboard program. I have finished coding the interface but I need the serial comm part... I heard that you might need to use MFC but I wasn't sure. Is there another way without having to create an MFC-based app?
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
  #2   Spotlight this post!  
Unread 01-20-2003, 07:23 PM
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Re: Serial Communication in C++

Quote:
Originally posted by Adam Shapiro
I'm having trouble finding resources on serial communication with c++ for the 3d dashboard program. I have finished coding the interface but I need the serial comm part... I heard that you might need to use MFC but I wasn't sure. Is there another way without having to create an MFC-based app?
http://www.robbayer.com - just go to the how-to link, and there is a tutorial on how to get a serial communication set up w/o using MFC.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #3   Spotlight this post!  
Unread 01-20-2003, 07:58 PM
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
Wow, I should have checked there first... thanks.
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
  #4   Spotlight this post!  
Unread 01-20-2003, 08:02 PM
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Quote:
Originally posted by Adam Shapiro
Wow, I should have checked there first... thanks.
Yup, it helps if you download RoboCon (found on his site) also...it comes with some nifty functions and all.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #5   Spotlight this post!  
Unread 01-20-2003, 08:32 PM
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
A word of warning: ignore everything it says about mult-threading unless you know what you are doing. It's messy and can lead to some insanely difficult bugs.

Instead, follow RoboCon's example, as it is not multi-threaded and works just fine. Just make sure you are looking at the RoboCon source, and not ConSample as ConSample is MFC, but RoboCon is not.

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #6   Spotlight this post!  
Unread 01-20-2003, 08:37 PM
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
And MFC is confusing if you haven't really done any Win32 Programming (to me it was anyways). Multi-threading doesn't work all that well w/ Win32 anyhow.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #7   Spotlight this post!  
Unread 01-20-2003, 08:52 PM
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
I've done a bit of MFC and Win32 but I didn't really want to add MFC to the app if I could avoid it. It is complex enough having to use Direct3D... I'll try RoboCon to see how it works. Hopefully I can get this program working soon so I can upload the code to our team website (which I need to finish too...).
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
  #8   Spotlight this post!  
Unread 01-20-2003, 11:40 PM
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
I've got a low overhead example of how to implement a software-based state machine that properly handles the dashboard data stream. If it'll help, you can find it on this page:

http://www.cvhsrobotics.org/resources.htm

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #9   Spotlight this post!  
Unread 01-21-2003, 12:49 PM
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;"
Closed Thread


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 02-08-2003 11:43 PM
Ever seen this serial port problem before??? Aidan F. Browne Programming 5 02-05-2003 12:03 PM
organized way of communication with FIRST? archiver General Forum 0 06-24-2002 04:20 AM
Serial Port Communication White Paper rbayer Programming 87 06-14-2002 04:10 PM
serial communication using c++ Malakili Programming 31 05-01-2002 03:51 PM


All times are GMT -5. The time now is 02:19 AM.

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