Bonescript : AnalogWrite error

72 views
Skip to first unread message

Md Khaled Hossain

unread,
Jun 5, 2016, 1:31:52 AM6/5/16
to BeagleBoard
Here I am trying to turn on a buzzer for one second and then turn it off. Here is the code

#!/usr/bin/env node
var b = require('bonescript');

b
.pinMode('P8_19', b.ANALOG_OUTPUT);


b
.analogWrite('P8_19', 0.5, 2000.0, printStatus);

function printStatus(x) {
    console
.log('x.value = ' + x.value);
    console
.log('x.err = ' + x.err);
}

setTimeout
(function() {
        b
.analogWrite('P8_19', b.low);     // Turn off buzzer after milliseconds time
   
}, 1000);

This code gives the following error after i try to run it immediately after reboot
error: Error enabling PWM controls: Error: ENOENT, no such file or directory '/sys/devices/ocp.3/bs_pwm_

test_P8_19.15/polarity'


how to solve the problem?


evilwulfie

unread,
Jun 5, 2016, 10:38:03 AM6/5/16
to beagl...@googlegroups.com
Have you loaded the PWM overlay ?
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/f30ed627-81cf-43af-913c-057e8446ece5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


evilwulfie

unread,
Jun 5, 2016, 12:10:54 PM6/5/16
to beagl...@googlegroups.com

One more tidbit
http://beagleboard.org/support/BoneScript/analogWrite/

Note: This function is currently incompatible with pinMode which may force the pin mux to GPIO mode only.


On 6/4/2016 10:31 PM, Md Khaled Hossain wrote:

William Hermans

unread,
Jun 5, 2016, 12:25:24 PM6/5/16
to beagl...@googlegroups.com
In which case. Unless you need something around 1-2Khz( at most ), Nodejs wont cut it.

Md Khaled Hossain

unread,
Jun 7, 2016, 11:42:13 PM6/7/16
to BeagleBoard
how to load the PWM overlay?

Md Khaled Hossain

unread,
Jun 7, 2016, 11:43:06 PM6/7/16
to BeagleBoard
william, I have tried with 1.5khz still the problem is same.
Reply all
Reply to author
Forward
0 new messages