1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-03 14:24:15 +01:00
Arduino/build/shared/examples/Stubs/AnalogReadWrite/AnalogReadWrite.pde

14 lines
185 B
Plaintext
Raw Normal View History

2009-07-11 02:34:59 +02:00
void setup() {
pinMode(6, OUTPUT);
}
void loop() {
int sensorValue = analogRead(2);
int ledFadeValue = map(sensorValue, 0, 1023, 0, 255);
analogWrite(6, ledFadeValue);
}