mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-08 23:46:08 +01:00
13 lines
184 B
Plaintext
13 lines
184 B
Plaintext
|
void setup() {
|
||
|
pinMode(6, OUTPUT);
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
int sensorValue = analogRead(2);
|
||
|
int ledFadeValue = map(sensorValue, 0, 1023, 0, 255);
|
||
|
analogWrite(6, ledFadeValue);
|
||
|
}
|
||
|
|
||
|
|
||
|
|