Thread: CAN Example
View Single Post
  #3   Spotlight this post!  
Unread 18-01-2011, 23:54
imac256 imac256 is offline
Registered User
AKA: Ian McInerney
FRC #2022 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2009
Rookie Year: 2009
Location: Aurora, IL
Posts: 30
imac256 is a glorious beacon of lightimac256 is a glorious beacon of lightimac256 is a glorious beacon of lightimac256 is a glorious beacon of lightimac256 is a glorious beacon of light
Re: CAN Example

My team used CAN last year, so our C++ code from 2010 contains examples. That code can be here.

I have attached excerpts of our code from last year which deal specifically with using the CAN bus. At the end of the file there is also an excerpt from the 2011 C++ RobotDrive class which shows how to use synchronization. (found in CANExamples.txt)

Synchronization uses an 8-bit mask which is sent to the motors when the output speed is set, and then a later function is used to send a packet to the Jaguars telling them to execute the previously sent command. A enumerated list of the synchronization groups can be found in the other attached file (synchronization.txt).

If you have any questions about any of the code examples I gave feel free to ask me.
Hope this helps.
Attached Files
File Type: txt CANExamples.txt (1.2 KB, 43 views)
File Type: txt synchronization.txt (547 Bytes, 16 views)
__________________
- Ian McInerney
Alumni & Mentor, Team 2022 Titan Robotics
Junior, Iowa State University majoring in Electrical Engineering
Reply With Quote