The Wiring 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: hbarragan [at] uniandes.edu.co
Name
read()
Examples
#include <Encoder.h>
int val;
Encoder myEncoder;
void setup() {
myEncoder.attach(2, 8);
encoderWrite(0, 0);
}
void loop() {
// Read the position or angle of the encoder variable
val = myEncoder.read();
}
Description
The read() method reads the position or angle of an encoder.