Go to Post Off season is a good way to go outside the district. - 346CADmen [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
  #16   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
  #17   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
  #18   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
  #19   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
  #20   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
  #21   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
  #22   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
  #23   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
  #24   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
  #25   Spotlight this post!  
Unread 01-02-2010, 18:48
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

ok, I made a new project in Windriver. I copied the entire WPILib and its files (most recent release) into that project, and made the change to the logical OR.

The build target is specified as "Windows-gnu-native-3.x-4.x-debug" (I'm assuming thats what you mean by building the debug version.)

The error is that it can't find "WPILib.h" after I run the updateBuiltInLibrary.cmd
Reply With Quote
  #26   Spotlight this post!  
Unread 01-02-2010, 18:52
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
ok, I made a new project in Windriver. I copied the entire WPILib and its files (most recent release) into that project...
The script is expecting the library source to be in "c:\WindRiver\workspace\WPILib" and if it's not there you will get this behavior.
Reply With Quote
  #27   Spotlight this post!  
Unread 01-02-2010, 18:59
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

Thank you sir. You have been most helpful!
Reply With Quote
  #28   Spotlight this post!  
Unread 02-02-2010, 00:59
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

Quote:
Originally Posted by jhersh View Post
I'm not sure... I have no control over release schedules.



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
That's quite understandable. Maybe in future seasons it'd be a good idea to do something along the lines of providing weekly updates that merge in the most critical patches for each language; updates that are helpful but not necessary would be included at longer intervals, perhaps only once per season.

The updates could be optional (e.g., not an 'official mandatory' team update) until the season draws to a close to prevent teams freaking out over things that aren't affecting them until ship draws close.

In any case, thanks a lot for your replies and the hard work you've been doing to make the lives of FIRST teams easier
__________________
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
  #29   Spotlight this post!  
Unread 03-02-2010, 19:34
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

Should the cRIO need to be re-imaged for the patched WPILib to take effect?

I find that I am still unable to write to the device.

Extra details:

I know I'm not writing to the device because after I write to PowerControl and DataFormat regAddress's, I read them, and get back nothing (0). I know I'm reading correctly because I can get the DeviceID just fine. I have patched the WPILib as previous posts have instructed, but I think there might be a missing last step or something obvious that I'm missing.

Last edited by tdidi : 03-02-2010 at 20:02.
Reply With Quote
  #30   Spotlight this post!  
Unread 04-02-2010, 02:22
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
Should the cRIO need to be re-imaged for the patched WPILib to take effect?

I find that I am still unable to write to the device.

Extra details:

I know I'm not writing to the device because after I write to PowerControl and DataFormat regAddress's, I read them, and get back nothing (0). I know I'm reading correctly because I can get the DeviceID just fine. I have patched the WPILib as previous posts have instructed, but I think there might be a missing last step or something obvious that I'm missing.
The cRIO does not need to be reimaged for the WPILib patch to take effect. WPILib is a static lib that is linked with your program and deployed with your application. If I were you I would double check that you are successfully building the library, running the script to install it, and relinking your application. Do something that would prove all these steps are working such as putting a printf inside one of the I2C methods you are changing. If it prints, you know you have linked against the new version of the library.

-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 22:41.

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