View Single Post
  #15   Spotlight this post!  
Unread 17-03-2013, 23:25
Todd's Avatar
Todd Todd is offline
Software Engineer
FRC #1071 (Team Max)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Connecticut, Wolcott
Posts: 51
Todd is just really niceTodd is just really niceTodd is just really niceTodd is just really niceTodd is just really nice
Re: CAN and Jaguars, any limits?

Quote:
Originally Posted by Jefferson View Post
Would you be willing to provide some sample code of how you accomplish this?
What programming language are you using?

As a trivial example, if in LabVIEW one were to determine in each robot mode (disabled, teleop, autonomous, etc) the command they wanted to send a motor and store it in a global variable, they could then read that global variable in timed tasks in a loop at whatever frequency they wished and call the set motor VI from there.

This can help free your Teleop loop to run as fast as ds packets are received.

Similar trivial examples can be constructed in C++ and Java.

There are a lot better ways that this could be handled, like using an action engine in LabVIEW, or a class in any other language rather than a global variable, but the general principle remains the same.
Reply With Quote