View Single Post
  #4   Spotlight this post!  
Unread 31-01-2010, 03:36
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: I've Got The Magnetic Encoders Working Over SPI

Quote:
Originally Posted by sparrowkc View Post
Please tell me what I did wrong and what could be improved.
You're correct... there is no official example for using this sensor over SPI.

From looking at your code it looks like you are accessing it correctly. Well done! You could clean it up a bit by choosing Most Significant Bit First in the Advanced Config VI... then you wouldn't have to reverse the data you get back (don't forget to change the output command too). I would also make subVIs out of the Open and Get parts of the functionality to make it easier to include in user code and remain encapsulated.

-Joe
Reply With Quote