#!/usr/bin/env node
////////////////////////////////////////
// blinkLED.js
// Blinks the USR LEDs and P9_14.
// Wiring: P9_14 connects to the plus lead of an LED. The negative lead of the
// LED goes to a 220 Ohm resistor. The other lead of the resistor goes
// to ground.
// Setup:
// See:
////////////////////////////////////////
const b = require('bonescript');
//const leds = ["USR0", "USR1", "USR2", "USR3"];
const leds = ["P8_14"];
for(var i in leds) {
b.pinMode(leds[i], b.OUTPUT);
}
var state = b.HIGH;
for(var i in leds) {
b.digitalWrite(leds[i], state);
}
setInterval(toggle, 250);
function toggle() {
if(state == b.LOW)
state = b.HIGH;
else
state = b.LOW;
for(var i in leds) {
b.digitalWrite(leds[i], state);
}
}
And have next messages
error: Unable to find LED beaglebone:green:usr0
error: Unable to find LED beaglebone:green:usr1
error: Unable to find LED beaglebone:green:usr2
error: Unable to find LED beaglebone:green:usr3
error: Unable to find gpio: /sys/class/leds/beaglebone:green:usr0/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr0/brightness
error: Unable to find gpio: /sys/class/leds/beaglebone:green:usr1/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr1/brightness
error: Unable to find gpio: /sys/class/leds/beaglebone:green:usr2/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr2/brightness
error: Unable to find gpio: /sys/class/leds/beaglebone:green:usr3/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr3/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr0/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr1/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr2/brightness
error: Unable to write to /sys/class/leds/beaglebone:green:usr3/brightness
I've updated kernel for BeagleBone Black from https://debian.beagleboard.org/images/bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz Try execute next script
And have next messages