On Wed, Sep 16, 2020 at 8:33 AM Pavel Yermolenko <py.oh...@sunrise.ch> wrote: > > Hello, > > I modified bone script pwm.js from Derek Molloy book, adapting pin for BBB > (in bold): > > var b = require('bonescript'); > var pin = "P9_21"; // Use P1.08 or P1.36 by default on PocketBeagle > var dutyCycle = 0.75; > var frequency = 10000; > > b.pinMode(pin, b.OUTPUT); > b.getPinMode(pin, printPinMux); > b.analogWrite(pin, dutyCycle, frequency, display); > > function printPinMux(val){ > console.log('mux = '+val.mux); > console.log('name = '+val.name); > } > > function display(val){ > console.log(val); > } > > Doesn't work: > > debian@beaglebone:~/exploringbb/chp06/bone$ sudo nodejs pwm.js > error: error updating PWM freq and value: > /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1/pwm-1:1, > Error: EINVAL: invalid argument, write > { err: > 'error updating PWM freq and value: > /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1/pwm-1:1, > Error: EINVAL: invalid argument, write' } > warning: single argument callbacks will be deprecated.please use node-style > error-first callbacks: callback(err,response) > mux = undefined > name = UART2_TXD > > Any suggestions ?
bonescript is being scrapped, use adafruit-beaglebone-io-python... https://github.com/adafruit/adafruit-beaglebone-io-python Regards, -- Robert Nelson https://rcn-ee.com/ -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYhFz%3DYoxnPayUOW9VeJrum2kJtAzZisYVZWjNsGKxGqKg%40mail.gmail.com.