Advertisement
3rdWard_Arduino

Class2_reading potentiometer

Feb 1st, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. /*
  2.   Reading a potentiometer on analog pin A0
  3.   and printing out the value
  4. */
  5.  
  6. int potValue = 0;
  7. int potPin = A0;
  8.  
  9. void setup(){
  10.  Serial.begin(9600);
  11. }
  12.  
  13. void loop(){
  14.  potValue = analogRead( potPin );
  15.  Serial.print("potValue = ");
  16.  Serial.println(potValue);
  17.  delay(100);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement