13 lines
229 B
C++
Executable File
13 lines
229 B
C++
Executable File
int sensorPin = A0;
|
|
int ledPin = 10;
|
|
|
|
void setup() {
|
|
}
|
|
|
|
void loop() {
|
|
// read the value from the sensor:
|
|
int val = analogRead(sensorPin);
|
|
int output = map(val, 0, 1023, 0, 255);
|
|
analogWrite(ledPin, output);
|
|
}
|