Go to Post Like fishing, some may get away as you are reeling them in, but never letting out enough line to get the big ones at the bottom is just disappointing. - Eric O [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-01-2011, 20:05
dcarr's Avatar
dcarr dcarr is offline
#HoldStrong
AKA: David Carr
FRC #3309 (Friarbots)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2009
Location: Anaheim
Posts: 954
dcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond reputedcarr has a reputation beyond repute
CAN Example

Can someone please post a working code example for CAN, it can be Java or C++. We're having some trouble.

Thanks,
James from Team 3309
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2011, 22:28
jtdowney jtdowney is offline
Boiler Up
AKA: John Downey
FRC #4302 (Robophins)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2006
Location: Chicago
Posts: 300
jtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant future
Re: CAN Example

There are some examples in the CANJaguar project on FIRST Forge. Specifically we were looking at this file to get started. The CANJaguar project is deprecated since the library is now part of WPILib but it still gives a good example with a similar API.
__________________
John Downey
Lead Robot Inspector - Purdue IndianaFIRST District
Whitney Young Magnet High School/Robophins (FRC 4302) - Mentor (2013-current)
Midwest Regional Planning Committee - Member (2012-current)
Boilermaker Regional Planning Committee - Member (2011-2014)
Robot Inspector (2008-current)
Purdue FIRST Programs - Staff Advisor (2008-2011)
Lafayette-Jefferson High School/Precision Guessworks (FRC 1646) - Mentor (2006-2011)
Reply With Quote
  #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
Reply


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


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

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