Go to Post I always mean what I say. I just don't always say what I mean. - dlavery [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-12-2008, 16:55
beefy1 beefy1 is offline
Registered User
None #2669
 
Join Date: Dec 2008
Location: Israel
Posts: 12
beefy1 is an unknown quantity at this point
Question about QuadEncoders [C++]

what does the Get function in Encoder class return? detailed explaination if you can, please
  #2   Spotlight this post!  
Unread 26-12-2008, 18:24
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Question about QuadEncoders [C++]

from Encoder.cpp:
Code:
/**
 * Gets the current count.
 * Returns the current count on the QuadEncoder.
 * @return Current count from the QuadEncoder.
 */
INT32 Encoder::Get(void)
{
	INT32 value = m_encoder->readOutput_Value(&status);
	wpi_assertCleanStatus(status);
	return value;
}
It returns the number of pulses received since the encoder was initialized or the count was reset.

Your other option is GetPeriod, which:
"Returns the period of the most recent Quad Encoder pulse in microseconds."
  #3   Spotlight this post!  
Unread 27-12-2008, 11:46
beefy1 beefy1 is offline
Registered User
None #2669
 
Join Date: Dec 2008
Location: Israel
Posts: 12
beefy1 is an unknown quantity at this point
Re: Question about QuadEncoders [C++]

well, but what happened if I change the direction, will the Get function give me the duplication of ticks or maybe the distance it passed?
  #4   Spotlight this post!  
Unread 27-12-2008, 11:54
Daniel_LaFleur's Avatar
Daniel_LaFleur Daniel_LaFleur is offline
Mad Scientist
AKA: Me
FRC #2040 (DERT)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Peoria, IL
Posts: 1,964
Daniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond repute
Send a message via MSN to Daniel_LaFleur
Re: Question about QuadEncoders [C++]

Quote:
Originally Posted by beefy1 View Post
well, but what happened if I change the direction, will the Get function give me the duplication of ticks or maybe the distance it passed?
Get Encoder does not get "ticks". It reads the number of counts from it's initialization/last reset. As the encoder turns in its forward direction it increases the encoder counts, as it turns in its reverse direction it decreases the encoder counts (even going negative).

I am not sure if GetPeriod will return a negative encoder period or not.
__________________
___________________
"We are not now that strength which in old days moved earth and heaven; that which we are, we are;
One equal temper of heroic hearts, Made weak by time and fate, but strong in will
To strive, to seek, to find, and not to yield. "
- Tennyson, Ulysses
  #5   Spotlight this post!  
Unread 27-12-2008, 12:17
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Question about QuadEncoders [C++]

No, GetPeriod will not return a negative number. It simply returns time passed between the last two pulses.

And yes, Daniel is right about the values Get() returns.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
question about judgeing legomaster3945 3D Animation and Competition 3 01-03-2008 23:40
A question about current.... Adam Y. Electrical 41 26-11-2004 21:46
Question about wheels Randy_Ai Technical Discussion 9 24-01-2002 17:14
Question about bumpers Randy_Ai Technical Discussion 2 23-01-2002 17:59
question about gyrochip wes16zeus Technical Discussion 3 13-11-2001 16:24


All times are GMT -5. The time now is 00:13.

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