View Single Post
  #14   Spotlight this post!  
Unread 15-04-2014, 10:59
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: using interrupts in FRC

Quote:
Originally Posted by Alan Anderson View Post
.....you wouldn't have needed to do any special programming. The FPGA lets you define a digital input pin as an encoder reset signal.
Quote:
Originally Posted by Hugh Meyer View Post
Would you provide more information about how to do this? Links to docs would be great. C++
It's obvious and straightforward in LabVIEW. The External Reset input terminal, and its associated polarity select, are at the top of the Encoder Open function icon.

In Java, some of the Encoder constructors accept a third Digital Input to specify the index signal.

In C++, it looks like the reset/index feature is not exposed in the Encoder class. That's unfortunate. I don't know enough about the low-level resource interface to the FPGA to be comfortable trying to suggest adding a new constructor that includes it.