node-rpio icon indicating copy to clipboard operation
node-rpio copied to clipboard

Node.js Exception

Open wqy24 opened this issue 2 years ago • 0 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

wqy24 avatar Mar 31 '23 12:03 wqy24