79463491

Date: 2025-02-24 12:20:21
Score: 1
Natty:
Report link

Finally succeeded using the node-libgpiod package

import pkg from 'node-libgpiod';
const { Chip, Line } = pkg;

global.chip = new Chip(4);
global.line = new Line(chip, 2);

line.requestInputMode();

const cycle = () => {
    const value = line.getValue();
    console.log(value);
};

setInterval(cycle, 50);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Lapidus