我正在尝试使用nodejs.

问题描述 投票:0回答:1

脚本无错误运行,但是每当我将引脚26和GND连接时,什么都不会发生。怎么了?

enter image description here 使用

node-libgpiod
node.js raspberry-pi gpio
1个回答
0
投票
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);

	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.