View Single Post
  #10   Spotlight this post!  
Unread 14-03-2012, 16:53
synthmusic synthmusic is offline
Registered User
FRC #3574
 
Join Date: Feb 2012
Location: Seattle
Posts: 5
synthmusic is an unknown quantity at this point
Re: Reading an absolute encoder via PWM in C++

Thanks everyone!

To avoid a hail of quotes, I'll simply summarize:

I tried the Counter class, but it didn't seem to want to do much more than, well, count. Every attempt at .GetPeriod() returned infinity, clearly hitting this Counter code:

Code:
double Counter::GetPeriod()
{
	tCounter::tTimerOutput output = m_counter->readTimerOutput(&status);
	double period;
	if (output.Stalled)
	{
		// Return infinity
		double zero = 0.0;
		period = 1.0 / zero;
	}
	else ...
and I could not convince it that it wasn't stalled so it would fall into the else. I made many iterations in the attempt, so I don't have any meaningful source to post showing it not working, which was my bad, if I try again I'll put something up.

RufflesRidge, I followed that link, and it does look promising, I shall try it out tonight.
Reply With Quote