Skip to content

Commit b7a0d87

Browse files
committed
Bugfix: Local variable 'potentiometer' is shadowing global variable
1 parent 34ccfcc commit b7a0d87

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

examples/ArduinoIoTCloud_LED_switch/ArduinoIoTCloud_LED_switch.ino

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,14 @@ void setup() {
4848

4949
void loop() {
5050
ArduinoCloud.update();
51-
52-
int potentiometer = analogRead(A0);
53-
51+
potentiometer = analogRead(A0);
5452
}
5553

56-
5754
/*
5855
this function is called when the "led" property of your Thing changes
5956
*/
6057
void onLedChange() {
6158
Serial.print("LED set to ");
6259
Serial.println(led);
6360
digitalWrite(LED_BUILTIN, led);
64-
}
61+
}

0 commit comments

Comments
 (0)