Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. int pot;
  2. int pot_map;
  3.  
  4. void setup() {
  5. pinMode(11,OUTPUT);
  6. Serial.begin(9600);
  7.  
  8. }
  9.  
  10. void loop() {
  11. // put your main code here, to run repeatedly:
  12. pot=analogRead(A0);
  13. pot_map=map(pot,0,1023,0,255);
  14. analogWrite(11,pot_map);
  15. Serial.println(pot);
  16. Serial.println(pot_map);
  17. delay(500);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement