Go to Post I <3 statistics. - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 03-11-2014, 14:46
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: I2C advice

Quote:
Originally Posted by 2B || !2B View Post
Are you referring to a master I2C class, or a master GY-85 class? The FIRST I2C class kept hanging up the robot because it would start another transaction when another was already active. I'm just making this class to make sure that doesn't happen, and to make the code look cleaner and nicer to read in general.
Perhaps I'm reading too much into your choice of name. I think you should attempt to write a class that is capable of interacting with the sensor you care about and nothing more. Speculative generality is your enemy. It will add complexity and give you nothing positive in return. You can always refactor in the future when you have new requirements.

I'm surprised that the Java class allowed more than one write at a time to the I2C bus. I haven't looked to see if that is a bug or a misunderstanding. Certainly on the new roboRIO that should not be possible due to the Linux device driver that must be talked to on the new system. Your class should not need to deal with this level of synchronization.
 


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

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