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 09fabcd commit a345101Copy full SHA for a345101
js/gpio-basic/gpio-basic.js
@@ -1,6 +1,4 @@
1
const gpiod = require('node-libgpiod');
2
-//const fetch = require('node-fetch');
3
-//const jwt = require('jsonwebtoken');
4
const { ArduinoIoTCloud } = require('arduino-iot-js');
5
6
const LED = 14; // GPIO14, Pin 8
@@ -15,8 +13,9 @@ chip = new gpiod.Chip('gpiochip4');
15
13
ledLine = chip.getLine(LED);
16
14
buttonLine = chip.getLine(BUTTON);
17
18
-ledLine.requestOutputMode();
19
-buttonLine.requestInputMode();
+ledLine.requestOutputMode("gpio-basic");
+// To configure the pull-up bias, use 32 instead of gpiod.LineFlags.GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP if it is undefined
+buttonLine.requestInputModeFlags("gpio-basic", gpiod.LineFlags.GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP);
20
21
let client;
22
0 commit comments