Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int pot, pwm;
  2.  
  3. void setup()
  4. {
  5.   pinMode(11, OUTPUT);
  6.   pinMode(A0, INPUT);
  7. }
  8.  
  9. void loop()
  10. {
  11.   pot = analogRead(A0);
  12.   pwm = map(pot, 0, 1023, 0, 255);
  13.   analogWrite(11, pwm);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement