serial communication using c++

Vanweric and I are thinking about doing some things with C++ and serial communication so we can control the robot with a laptop outside competition. Anyone know anything about this?

Thanks for the Help.

ALSO: Im new here, im on team 250 with vanweric, ill be around here more often from now on, so now you know who i am :slight_smile:

First of all, welcome. Can i say that, i’ve only been here a few monthes. bah, i’ll say it anyways. :stuck_out_tongue:

Any way, if you can figure out how to do something with the serial port and C++, i’d love to help, cause i’m learning C++ this year, and so far, i actually got really far. i’m always trying to learn more, and what better way than learning how to play with the actual hardware?

i actually have a family friend that programs palm pilots, and when you make a palm pilot program, you use either C or C++ to create a program to “Hot Sync” the palm pilot and the computer, to download the program to the palm. if you want, i can ask him, cause to go from C to C++ won’t be that hard (i hope :D).

another thing we could possibly do, is create a simluator, which will let a laptop or something else emulate the robot controller and operator interface. i’m not sure how either works, beyond the PBASIC code used to program them. i know that many people, including myself, would like to create a simluator, which would make our lives much easier.

so, i’ll try to find out about the serial port, and if i can get anything, i’ll post it up. although, i can’t say if i’ll get anything in C++, cause my friend is a C kinda guy. :stuck_out_tongue:

somethnig i just found, although i don’t quite understand. you can get it here…

http://www.myspace.d2g.com/first/CD_stuff/serial_1.zip

no, i didn’t make it, and i don’t quite understand it all. the basic stuff makes sense to me, but don’t ask me to explain it to you, cause you’ll wind up more confused than i am. :smiley:

Thanks,

Are you going to Florida for Nationals? If so we should meet there. Also, ask that friend who programs Palms if he knows anything… post back if you find out anything

well, didn’t get a chance to email my friend, i’ll try today. have to ask my dad for his email address :p. and yes, i will be at florida. team 810, Mechanical Bulls. the serial class up in my other post doesn’t seem to work when i try it, but if anyone else can make it work, try it. we may need to resort to assembly language to make it work, and i don’t know that.

these look good, im still trying to figure out how to use them though, someone wanna give it a shot?

http://www.marshallsoft.com/wsc4c.htm

Are we talking about Visual C++ or Borland C++? Or something else?

well, i’m talking VC++, cause that’s what i know. i wasn’t aware of a difference between the two, although if there is, i only know VC++.

C++ is C++ regardless of what compiliar you use. The only thing I know Microsoft did in their program that kinda effects the language is they automatically include the boolean header file in all programs. The program I use, Symantec C++ however does not, I need to do a little #include “bool.h” everytime I need to use it.

I was thinking that VC++ used different methods to access drivers (like your serial port driver) so that the programs could work through Windows more efficiently. Maybe not…

Unless you can find out how the data is transmitted and processed inside the robot controller, you are SOL… Those team numbers are on there for a reason… it actually sends them…

You could probabaly hook the laptop up to the operator interface and use that as a controller… but as for the laptop emulating the operator interface, that would take some time… Hmmmmm… sounds like a good project. You have me interested now…

well, i’ve been busy doing lots of C++ work in school. we had to make our own class, that emulated an ATM machine, saved account info, and then transactions. made myself a cool little program, actually had to look somethings up myself, cause i’ gettnig too advanced for my teacher. :smiley:

anyways, i haven’t had much time to look at the serial port classes. can anyoen who’s been doing C++ for a while try looking for some that work? maybe even explain how they work after too? :stuck_out_tongue:

If you have the MSDN Library (it comes with VC++) do a search for “Serial Communications in Win32”. It should return a rather lengthy technical article that describes everything you need to do. While it is just plain-'ol C instead of C++, it should work for you.

If you don’t have the Library, I can try to find another place with the same info.

i think i have the library, but i didn’t install it. maybe i will now. :stuck_out_tongue:

YAY! MY dad’s friend, who is a palm programmer, said he’d help me to control the robot through a palm. :stuck_out_tongue: if i can figure that out, a laptop can’t be that much harder. :smiley: i’ll get back to you with an results.

Fine, you guys got me curious… I’m going to turn this into a personal project…

A project like this could take a while. Innovation FIRST provides no information about the operation of the devices, so you’re going to have to reverse-engineer it…

Hey… I may be able to even turn it into my presentation for my Assembly class.

Sounds hard…you will have to replicate the entire OI as a Palm program? Sounds like a lot of work, and how are you going to control the robot? The only inputs you can use will be the stylus & buttons, so it seems like driving would be kind of clumsy.

Good luck, just some things I was wondering about :slight_smile:

Okay… first major setback.

The radio modems and the OI/RC use RS-422 ports. They communicate differently than standard serial RS-232 ports found in your computer. In short, no radio modems unless you figure out a way to work around this problem… I’ll research it more… Converters are available to convert it electrically, but it’ll cost ya $80.

I don’t know if the tether port also uses this method of communication…

well, for controlling it with a palm, after i get that done, i’d be able to do more thnigs with it. have to start somewhere. :smiley: also, could you use the O/I as a go through, and just put everything on one port? you have the 4 analog and 4 digital switches. you can run something on that me thinks.

you have the 4 analog and 4 digital switches. you can run something on that me thinks.

True, but how would you get the data to the joystick port? A joystick uses one pin for each axis and each button. On the standard CH joysticks, thats eight pins. Serial only uses one pin for the actual data. Just something to think about.

Not trying to be a pessimist, but I don’t see how the tether could be official RS-232 because it can power the OI. Who knows? Maybe I’m just wrong and it actually is. Only time will tell.

grr, so many problems. we’ll find a way though. :smiley: