Skip to content

Instantly share code, notes, and snippets.

@maximeadjigble
Created May 2, 2019 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximeadjigble/fcb814019354ffc8be869f245cae972d to your computer and use it in GitHub Desktop.
Save maximeadjigble/fcb814019354ffc8be869f245cae972d to your computer and use it in GitHub Desktop.
int ledPin = 3;
int valPot = 0;
void setup() {
}
void loop() {
valPot = analogRead(A0);
valPot = map(valPot, 0, 1023, 0, 255);
analogWrite(ledPin, valPot);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment