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 ?

Thanks.

-- 
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/0ee2a7ee-f815-42ea-9a77-4d71cc7fe017o%40googlegroups.com.

Reply via email to