Encoder\ Encoder \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0024+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### Encoder
Examples |
    #include "Encoder.h"

    Encoder myEncoder;
    int val;

    void setup() {
      myEncoder.attach(2, 8);  // attach an ecoder to pins 2 and 3.
    }

    void loop() {
      val = myEncoder.read();
    }
Description | Encoders are sensors used to track absolute or relative position. The Wiring Encoder library allows for easily manipulating shaft encoders. Encoders generate pulses when moved, on each pulse triggering an event on the Wiring I/O board, for this reason the phaseA pin of an encoder can only be connected to a Wiring pin capable of generating external interrupts. Four pins on the Wiring I/O board are capable of external interrupts for the Encoder library: pins 2, 3, 38 and 39, so only four encoders can be working at the a time.
Syntax |
    Encoder
Methods |
attach() |
detach() |
write() |
read() |
attached() |
Returns | None
Usage | Application

Updated on October 31, 2009 01:47:04pm PDT