Go to Post Robot? What robot?! - LightWaves1636 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-01-2010, 20:43
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Help with 2010 Accelerometer & I2C

Yeah the address given in the Sensor Guide says 0x3A, and I figure its all in 8bit for the WPI Function, so the 0x1D wouldn't work with that but 0x3A would?? I really don't know I2C or WPI's implementation of it, so I don't really know. I'm going to keep playing with it tonight.

I also just found the register map, didn't see it in the datasheet when I worked on it last, don' know how I missed it.

The biggest issue I am having now is whenever I call the read or write function the robot freezes up, and my console output shows nothing. This is both when I try to perform a read or a write....
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2010, 22:53
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Help with 2010 Accelerometer & I2C

Any luck so far? It would be awesome if you got this working.
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 20-01-2010, 02:06
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by wt200999 View Post
The biggest issue I am having now is whenever I call the read or write function the robot freezes up, and my console output shows nothing. This is both when I try to perform a read or a write....
I did find an issue with the initial release of the I2C for this year. The bug was introduced since last year. See details here: http://firstforge.wpi.edu/sf/go/artf1144

This bug would prevent the accelerometer from working.
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2010, 09:58
bcieslak
 
Posts: n/a
Smile Re: Help with 2010 Accelerometer & I2C

Yippeee!! everything is finally working....We re imaged the Crio, made sure 'ALL' the updates were applied to the driver station and the development laptop, compiled then downloaded the BuiltinDefaultCode.out file.

Then we added Joe's accelerometer code and fixed the I2C.cpp file. and all still worked.

We had some problems with the IterativeDemo but I we'll revisit that later. The BuiltinDefaultcode is what we will base our robot code on.

Thanks to all especially Joe Hersh for all the info and his patience..They don't pay you enough...Every one should send Joe a starbucks gift card so he can buy enough coffee to keep him awake when he sending those responses at 3 AM..

Brian C
Reply With Quote
  #5   Spotlight this post!  
Unread 22-01-2010, 14:07
JDM JDM is offline
programming lead; team executive;..
FRC #2199 (Robo-Lions)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Eldersburg, Maryland
Posts: 34
JDM is on a distinguished road
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by bcieslak View Post
Yippeee!! everything is finally working....We re imaged the Crio, made sure 'ALL' the updates were applied to the driver station and the development laptop, compiled then downloaded the BuiltinDefaultCode.out file.

Then we added Joe's accelerometer code and fixed the I2C.cpp file. and all still worked.
Would you mind posting all the code that got it working for you? Hopefully that should speed it up for everyone.

Thanks
Reply With Quote
  #6   Spotlight this post!  
Unread 22-01-2010, 15:05
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by JDM View Post
Would you mind posting all the code that got it working for you? Hopefully that should speed it up for everyone.
Here's the discussion where I posted the initial support: http://decibel.ni.com/content/thread/5634

It will be officially included and supported in the next C++ update.
Reply With Quote
  #7   Spotlight this post!  
Unread 31-01-2010, 12:33
nabioullinr nabioullinr is offline
Registered User
FRC #1073
 
Join Date: Jan 2010
Location: Hollis, NH
Posts: 17
nabioullinr has a spectacular aura aboutnabioullinr has a spectacular aura aboutnabioullinr has a spectacular aura about
Re: Help with 2010 Accelerometer & I2C

For some reason I keep receiving 0.0 from GetAcceleration(); am I instantiating the accelerometer correctly?:
ADXL345_I2C(4, ADXL345::kRange_2G)

(assuming the digital sidecar is connected to slot 4)
Reply With Quote
  #8   Spotlight this post!  
Unread 31-01-2010, 13:54
nabioullinr nabioullinr is offline
Registered User
FRC #1073
 
Join Date: Jan 2010
Location: Hollis, NH
Posts: 17
nabioullinr has a spectacular aura aboutnabioullinr has a spectacular aura aboutnabioullinr has a spectacular aura about
Re: Help with 2010 Accelerometer & I2C

We attached an oscilloscope to the bus and noticed that the data returned from the slave accelerometer is 0 for all three transactions (x, y, z); could it be attributed to some sort of a power saving feature which is not disabled?
Reply With Quote
  #9   Spotlight this post!  
Unread 31-01-2010, 16:23
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by nabioullinr View Post
We attached an oscilloscope to the bus and noticed that the data returned from the slave accelerometer is 0 for all three transactions (x, y, z); could it be attributed to some sort of a power saving feature which is not disabled?
I'm guessing you didn't fix WPILib... http://www.chiefdelphi.com/forums/sh...5&postcount=12

If you fix the I2C library it should start working for you.
Reply With Quote
  #10   Spotlight this post!  
Unread 01-02-2010, 15:52
nabioullinr nabioullinr is offline
Registered User
FRC #1073
 
Join Date: Jan 2010
Location: Hollis, NH
Posts: 17
nabioullinr has a spectacular aura aboutnabioullinr has a spectacular aura aboutnabioullinr has a spectacular aura about
Re: Help with 2010 Accelerometer & I2C

How would I patch wpilib? I could not find anything useful (besides the description of the bug).
Reply With Quote
  #11   Spotlight this post!  
Unread 01-02-2010, 16:07
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by nabioullinr View Post
How would I patch wpilib? I could not find anything useful (besides the description of the bug).
Download the source code, change the logical OR to a bitwise OR, build the library, run the Scripts/updateBuiltInLibrary.cmd file to install the compiled library, rebuild your project.

-Joe
Reply With Quote
  #12   Spotlight this post!  
Unread 01-02-2010, 16:41
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: Help with 2010 Accelerometer & I2C

Will this patch be in a team update soon? It's not good that teams already have gone this long with broken support for something in the KoP...
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
Reply With Quote
  #13   Spotlight this post!  
Unread 01-02-2010, 16:57
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by Shinigami2057 View Post
Will this patch be in a team update soon?
I'm not sure... I have no control over release schedules.

Quote:
Originally Posted by Shinigami2057 View Post
It's not good that teams already have gone this long with broken support for something in the KoP...
I know... that's why I've tried to provide timely workarounds, fixes, problem notifications, feature implementation examples, and support the best I can so that teams will not be held up by the release schedules. It's not ideal to need to patch these things manually, but it's also not good to force every team to install and keep track of 10+ updates in various languages that would all be released independently and out of phase with each other. Many teams can't keep up with the one update released at kickoff.

-Joe
Reply With Quote
  #14   Spotlight this post!  
Unread 01-02-2010, 18:21
tdidi tdidi is offline
Registered User
FRC #2619
 
Join Date: Jan 2010
Location: Midland, MI
Posts: 7
tdidi is an unknown quantity at this point
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by jhersh View Post
Download the source code, change the logical OR to a bitwise OR, build the library, run the Scripts/updateBuiltInLibrary.cmd file to install the compiled library, rebuild your project.

-Joe
I don't get it. I follow those instructions exactly, and it removes the WPILib from Windriver completely when I run the updateBuiltInLibrary.cmd.

I get the "no such file or directory" error.
Reply With Quote
  #15   Spotlight this post!  
Unread 01-02-2010, 18:33
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Help with 2010 Accelerometer & I2C

Quote:
Originally Posted by tdidi View Post
I don't get it. I follow those instructions exactly, and it removes the WPILib from Windriver completely when I run the updateBuiltInLibrary.cmd.

I get the "no such file or directory" error.
That probably means you didn't build the library successfully. Make sure you build the debug version, since that's what the script copies.

What file or directory exactly does it fail on?

-Joe
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
2010 Accelerometer Documentation? JDM Sensors 13 18-01-2010 12:42
Accelerometer Help? elbuo Programming 16 19-01-2009 13:01
accelerometer help!! wildcats Electrical 2 18-01-2009 15:51
Accelerometer Help! Questions4mQ202 Electrical 4 15-01-2009 19:44
Accelerometer help Red Mage Programming 3 30-01-2008 18:49


All times are GMT -5. The time now is 11:54.

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