Files
arduino-tests/analog.ino
Daniel Cortes 5bced5bc2c Initial commit
2020-05-22 01:27:14 -04:00

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);
}