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
detach()
Examples
#include <Encoder.h>
Encoder myEncoder;
int position;
void setup() {
myEncoder.attach(2, 8) // attaches a encoder with phaseA connected to pin 2 and phaseB connected to pin 8
}
void loop() {
if(myEncoder.attached()) {
position = myEncoder.read(); // read the encoder position
myEncoder.detach();
}
}
Description
The detach() method detaches an Encoder variable from the pins used to attach the encoder.