We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e495eb2 commit b68b513Copy full SHA for b68b513
js/gpio-basic/gpio-basic.js
@@ -22,7 +22,7 @@ let client;
22
// This function is executed every 1.0 seconds, polls the value
23
// of the button and sends the data to Arduino Cloud
24
function readButton(client) {
25
- button = buttonLine.getValue() ? true : false;
+ let button = buttonLine.getValue() ? true : false;
26
if (client)
27
client.sendProperty("button", button);
28
console.log("pollButton:", button);
@@ -65,5 +65,5 @@ const pollValue = setInterval(() => {
65
66
// Poll Button every 1 seconds
67
const pollButton = setInterval(() => {
68
- readButton();
+ readButton(client);
69
}, 1000);
0 commit comments