View Single Post
  #5   Spotlight this post!  
Unread 08-03-2006, 18:45
JJG13's Avatar
JJG13 JJG13 is offline
Yoda
AKA: Joshua Graffman
None #0180 (SPAM)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Martin County, Florida
Posts: 105
JJG13 has a spectacular aura aboutJJG13 has a spectacular aura aboutJJG13 has a spectacular aura about
Re: simulator (now that the bot is shipped)

Quote:
Originally Posted by lkdjm
Would you be so kind as to give us a hint on how to do that? Did you make that in visual basic? (i have that so i could do it!) If you posted that program entirely I would be forever in your debt. Thanks
-Dave
-564.first@gmail.com

First I modified the code until it would actually compile on my computer. To do this I put #ifdef COMPILE_FOR_ROBOT... #endif around much of the hardware specific code in the .c files such as ifi_startup.c. I then created a new file called PCCompile.c to contain my version of all the functions I removed using that method as well as functions in FRC_library.lib. I chose to create the GUI in a different program since I HATE writing GUIs in straight C using the windows API and I did not want the gui code mixed with the robot code. To communicate between the robot code and the GUI I used the window's clipboard. Now here's the clever part. I used my versions of GetData and PutData in PCCompile.c to facilitate the communication between the two programs. The robotcode currently sends txdata, and the relay values via the clipboard in PutData and receives rxdata and the digital inputs in GetData. I had to do several other things to make the code work and I'll probably write a whitepaper to explain this in more detail once I get enough time.

Edit: Attached are the PCCompile.c and PCCompile.h files. This contains most of the code that makes the simulator work.
Attached Files
File Type: c PCCompile.c (4.3 KB, 48 views)
File Type: h PCCompile.h (2.2 KB, 33 views)
__________________
Behold the power of SPAM.

Last edited by JJG13 : 08-03-2006 at 18:51.