Advertisement
gabbyshimoni

ReadPotValue

Jan 29th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. /*
  2.  * 29.01.2019
  3.  * Written by: Gabby Shimoni
  4.  * Description:
  5.  * This program read the value of a potentiometer connected to analog pin A0
  6.  * and print the value to the serial monitor
  7.  */
  8.  #define potPin A0
  9.  int potValue = 0;
  10. void setup() {
  11.   Serial.begin(9600);
  12. }
  13.  
  14. void loop() {
  15.  potValue = analogRead(potPin);
  16.  Serial.print("Pot value = ");
  17.  Serial.println(potValue);
  18.  delay(200);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement