Index
 
  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  

analogWrite()

   
Examples  
int outpin = 0; 
int val = 0; 
 
void setup() { 
 
} 
 
void loop() { 
  analogWrite(outpin, val);  // sets the value of analog pin 0 
  val = (val + 10) % 1023;   // increment value and keep it in 
                             // the 0-1023 range. 
} 
 

Description   The analogWrite() method sets the value of an analog output (PWM) pin. Possible values range from 0 to 1023, where 0 is 0 volts and 1023 is 5 volts. The analogWrite() command works on PWM (analog output) pins 0-5 (in the Wiring I/O board as a separate section for easiness). It is also possible to use the digital pin numbering 37, 36, 35, 31, 30 and 29 respectively.

analogWrite()는 아나로그 출력핀에 값을 출력합니다. 0 부터 1023 까지의 양의 값이며 0 은 0V 그리고 1023 그리고 5V가 됩니다. analogWrite() 명령은 PWM(아나로그 출력)핀 0-5에 해당됩니다. 아나로그 출력핀은 디지털 핀 번호 37, 36, 35, 31, 30 그리고 29 에 대응합니다. 

   
Syntax  
analogWrite(pin,value)
   
Parameters  
pin   int: PWM 출력핀 번호

value   int: 0-1023 범위의 숫자

   
Returns   None
   
Usage   Application
   
Related   analogRead()