Advertisement
3rdWard_Arduino

class2_pot

Jun 10th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. // set pin numbers:
  2. int potPin = A0;     // the number of the potentiometer pin
  3.  
  4. // variables will change:
  5. int potValue = 0;         // variable for reading the pot value
  6.  
  7. void setup() {
  8.   // initialize the Serial communication
  9.   Serial.begin(9600);  
  10. }
  11.  
  12. void loop(){
  13.   // read the value of the pot:
  14.   potValue = analogRead(potPin);
  15.  
  16.   Serial.println(potValue);
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement