Go to Post Since you have to undo all the connections anyway in order to swap them, you might as well take advantage of the opportunity to do some simple and straightforward troubleshooting. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 04-03-2015, 14:09
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
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
__________________
2015-2016 CSA
Software Engineering Student @ Johnson & Wales University
Team 228, Gus Robotics Inc.
Facebook
FLL Mentor for 1107, Edison Eagles!
2015- CT State Champions
2012- WPI Finalist(Thanks 1884 and 549), Spirt, Best Website
2011- WPI Chairman's award winners!
2010- WPI Champions! (thanks 230 & 20), WPI Engineering Inspiration, CT Best Website, CT VEX Champions (VRC228, VRC228b) (21-1-0)
2009- QCC VEX Champions (VRC228) (11-0-0), Innovate Award (VRC228)
Reply With Quote
  #2   Spotlight this post!  
Unread 04-03-2015, 15:00
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
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.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #3   Spotlight this post!  
Unread 04-03-2015, 15:50
MikeF1617 MikeF1617 is offline
Registered User
AKA: Michael Fischler
FRC #1124 (UberBots)
Team Role: Programmer
 
Join Date: Sep 2013
Rookie Year: 2013
Location: United States
Posts: 15
MikeF1617 is an unknown quantity at this point
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.
Attached Files
File Type: vi gyro-i2c.vi (13.9 KB, 5 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 05-03-2015, 16:59
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
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
__________________
2015-2016 CSA
Software Engineering Student @ Johnson & Wales University
Team 228, Gus Robotics Inc.
Facebook
FLL Mentor for 1107, Edison Eagles!
2015- CT State Champions
2012- WPI Finalist(Thanks 1884 and 549), Spirt, Best Website
2011- WPI Chairman's award winners!
2010- WPI Champions! (thanks 230 & 20), WPI Engineering Inspiration, CT Best Website, CT VEX Champions (VRC228, VRC228b) (21-1-0)
2009- QCC VEX Champions (VRC228) (11-0-0), Innovate Award (VRC228)
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 03: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