Skip to content

Commit 42f8e54

Browse files
authored
Use unambiguous pin name for Knob example's analog input
The previous use of "0" for the potentiometer pin can be a source of confusion because the correct connection is not to the pin on the board marked "0". Although analogRead() supports either analog channel number or pin name, it is most user friendly to use the pin name as it is labeled on the Arduino boards. This change is compatible with the tutorial, which shows the pin as "A0" in the schematic, and refers to it as "analog input 0" in the description.
1 parent a98c543 commit 42f8e54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/Knob/Knob.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Servo myservo; // create servo object to control a servo
1313

14-
int potpin = 0; // analog pin used to connect the potentiometer
14+
int potpin = A0; // analog pin used to connect the potentiometer
1515
int val; // variable to read the value from the analog pin
1616

1717
void setup() {

0 commit comments

Comments
 (0)