Encoder::write()\ 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.

Class | Encoder
Name | ### write()
Examples |
    #include "Encoder.h"

    boolean firstTime = true;
    Encoder myEncoder;

    void setup() {
      myEncoder.attach(2, 8);
    }

    void loop() {
      // Set the encoder's postion to 0
      if(firsttime == true) {
        myEncoder.write(0);
        firstTime = false;
      }
    }
Description | The write() method sets the the encoder position, it can be used to initialize it, or reset it.
Syntax |
    encoder.write(value)
Parameters |
value | int
encoder | The Encoder variable
Returns | None
Usage | Application

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