Reference for Wiring 1.0 (ALPHA) 0017+. 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.
analogRead()는 아나로그
입력 핀으로부터 값을
읽습니다. 0 부터 1023
까지의 값이며 0 은 0V
그리고 1024 는 5V 를
의미합니다.