Advertisement
jbn6972

analog_read(read Potentiometer and display in serial monitor)

Feb 18th, 2022
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. void setup() {
  2.   // initialize serial communication at 9600 bits per second:
  3.   Serial.begin(9600);
  4. }
  5.  
  6. // the loop routine runs over and over again forever:
  7. void loop() {
  8.   // read the input on analog pin 0:
  9.   int sensorValue = analogRead(A0);
  10.   // print out the value you read:
  11.   Serial.println(sensorValue);
  12.   delay(1);        // delay in between reads for stability
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement