jperkin / node-rpio

Raspberry Pi GPIO library for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js Exception

wqy24 opened this issue · comments

var rpio = require("rpio");

rpio.init({mapping: "physical"});
rpio.open(8, rpio.INPUT, rpio.LOW);
rpio.open(12, rpio.OUTPUT, rpio.LOW);

while (true) {
  if (rpio.read(8)) {
    rpio.write(12, rpio.HIGH);
  } else {
    rpio.write(12, rpio.LOW);
  }
}

This could not work on:

  • RPi 2 Model B Rev1.2
  • Node.js 18.15.0

Message: Segmentation fault