analogRead() \ 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 | ### analogRead()
Examples |
    int inpin = 0;
    int val = 0;

    void setup() {
      Serial.begin(9600);
    }

    void loop() {
      val = analogRead(inpin);  // read the value of analog pin 0
      Serial.print(val / 4);    // write the scaled value to the serial port
    }
Description | The analogRead() method reads the value of an analog input pin. Possible values range from 0 to 1024, where 0 is 0 volts and 1024 is 5 volts.
Syntax |
    analogRead(pin)
Parameters |
pin | int
Returns | int
Usage | Application
Related | analogWrite()

Updated on November 01, 2009 11:30:51pm PST