Libraries \ FirmataProcessing

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

Class

Wiring

Name

analogRead()

Examples
import processing.serial.*; //Import the Serial i/o and the Wiring Libraries
import Wiring.*;
Wiring wiring; //Create a Wiring object

int val;
void setup() {
  println(Wiring.list()); //print the serial devices list
  wiring = new Wiring ( this, Wiring.list()[1], 57600); //inicialized the wiring object
}
void draw() {
  val=Wiring.analogRead(0);
  println(val);
}
Description The analogRead() method reads the value of an analog input pin. Possible values range from 0 to 1023, where 0 is 0 volts and 1023 is 5 volts.
Syntax
Wiring.analogRead(pin)
Parameters
pin int: pin number.
Returns int
Usage Application
Updated on July 07, 2011 11:10:09pm PDT

Creative Commons License