Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #define potpin 0 // pot is connected to analog pin 0
  2.  
  3. int val = 0; // value of pot
  4.  
  5. void setup(){
  6. Serial.begin(9600); // start serial connection @ 9600 baud
  7. pinMode(potpin, INPUT); // our pot is an input
  8. }
  9.  
  10. void loop(){
  11. val = analogRead(potpin);
  12. Serial.println("Pot Val: " + val);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement