encoders.h File Reference

Contains functions for reading encoder values. More...

Go to the source code of this file.

Defines

#define LEFT   0
 Left wheel.
#define RIGHT   1
 Right wheel.
#define ENCODER_MAGNET_FAILURE   1025
 Magnet misaligned - likely distance from encoder problem.
#define ENCODER_MISALIGNED   1027
 Encoder misaligned - likely on XY plane.
#define ENCODER_DATA_NOT_READY   1026
 Not enough time has passed - encoders not initialized in hardware.
#define ENCODER_DELAY   20
 delay_ms argument after a full read is complete
#define OCF   _BV(4)
#define COF   _BV(3)
#define LIN   _BV(2)
#define MagINCn   _BV(1)
#define MagDECn   _BV(0)
#define BUFFER_SIZE   23
 Buffer size.

Functions

void encoders_init (void)
 Initialize encoders.
int encoder_read (char encoder)
 Read instantaneous encoder value.
int encoder_get_dx (char encoder)
 Get total distance traveled.
void encoder_rst_dx (char encoder)
 Reset distance counter.
int encoder_get_tc (void)
 Get time count: The number of encoder reads that have occurred.
void encoder_rst_tc (void)
 Reset the time count.
void encoder_wait (int nReadings)
 Waits for the next n encoder reading, then returns.


Detailed Description

Contains functions for reading encoder values.

Contains high and low level functions for reading encoders including reading out total distance covered, and eventually velocity.

Author:
Colony Project, CMU Robotics Club

Generated on Mon Sep 7 19:07:28 2009 for libdragonfly by  doxygen 1.5.9