The Wiring 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: hbarragan [at] uniandes.edu.co
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) % 255; // increment value and keep it in
// the 0-255 range.
}
Description
The analogWrite() method sets the value of an analog output (PWM) pin. Possible values range from 0 to 255, where 0 is 0 volts and 255 is 5 volts.