Skip to content

Commit b68b513

Browse files
committed
FIX: gpio-basic.js
1 parent e495eb2 commit b68b513

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/gpio-basic/gpio-basic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let client;
2222
// This function is executed every 1.0 seconds, polls the value
2323
// of the button and sends the data to Arduino Cloud
2424
function readButton(client) {
25-
button = buttonLine.getValue() ? true : false;
25+
let button = buttonLine.getValue() ? true : false;
2626
if (client)
2727
client.sendProperty("button", button);
2828
console.log("pollButton:", button);
@@ -65,5 +65,5 @@ const pollValue = setInterval(() => {
6565

6666
// Poll Button every 1 seconds
6767
const pollButton = setInterval(() => {
68-
readButton();
68+
readButton(client);
6969
}, 1000);

0 commit comments

Comments
 (0)