|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Help using I2C Gyro
Our team wants to use this sensor: https://www.sparkfun.com/products/11977
but i have no clue where to start on the code side, i know it uses I2C which is easy on an arduino but it seems more difficult for the Roborio. could anyone please make a quick mockup of how the code would look it would be greatly appreciated. Thanks, Matt |
|
#2
|
|||
|
|||
|
Re: Help using I2C Gyro
I don't what language you are using, but here is a mostly working driver that I wrote for it in Java. It should be easy to translate to C++, and at least give a little help if you use LabView. It requires some specific code form our libraries, but that should be pretty easy to get rid of. Feel free to ask if you want more explanation of how it works.
I never got it working perfectly, it seemed to filter out many of the small samples, but since we ended up not using it, I stopped working on it. |
|
#3
|
|||
|
|||
|
Re: Help using I2C Gyro
I'm not sure if this is much help, but here is what I found and put together.
This is someone trying to do it in Java, and I took some information from there: http://forums.usfirst.org/showthread...3340#post93340 It seems that there needs to be an initial command of 0x00 (same as 0) to set it to continuous measurement mode, then just read the data 6 bytes at a time (what the java code does, might need changing). But maybe this is not needed and just managed by the LabVIEW I2C code by itself, so it probably does not need to be included. I put together a VI with the different parts of code needed, hope this is of some help. Another option is to go with the gyro that your team probably has that looks like this: Product: http://www.andymark.com/product-p/am-2067.htm Datasheet: http://www.usfirst.org/sites/default...meter-Gyro.pdf which should have come in previous year's kit of parts, I believe. My team is using this gyro this year, it is much easier since you can open it on an analog port with the gyro VIs in the WPI library. |
|
#4
|
|||
|
|||
|
Re: Help using I2C Gyro
Ill try using the java code as a reference, we are trying to do this in labview if that helps anyone trying to explain it, thanks
Matt |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|