| 
 | " 2013 FRC Java API" | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CounterBase
Interface for counting the number of ticks on a digital input channel. Encoders, Gear tooth sensors, and counters should all subclass this so it can be used to build more advanced classes for control and driving.
| Nested Class Summary | |
|---|---|
| static class | CounterBase.EncodingTypeThe number of edges for the counterbase to increment or decrement on | 
| Method Summary | |
|---|---|
|  int | get()Get the count | 
|  boolean | getDirection()Determine which direction the counter is going | 
|  double | getPeriod()Get the time between the last two edges counted | 
|  boolean | getStopped()Determine if the counter is not moving | 
|  void | reset()Reset the count to zero | 
|  void | setMaxPeriod(double maxPeriod)Set the maximum time between edges to be considered stalled | 
|  void | start()Start the counter | 
|  void | stop()Stop counting | 
| Method Detail | 
|---|
void start()
int get()
void reset()
void stop()
double getPeriod()
void setMaxPeriod(double maxPeriod)
maxPeriod - the maximum period in secondsboolean getStopped()
boolean getDirection()
| 
 | " 2013 FRC Java API" | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||