Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable pwm output #26

Open
jadonk opened this issue Apr 25, 2018 · 3 comments
Open

disable pwm output #26

jadonk opened this issue Apr 25, 2018 · 3 comments
Assignees

Comments

@jadonk
Copy link
Member

jadonk commented Apr 25, 2018

From @colinbes on June 4, 2014 19:7

I am running bonescript 0.2.4 on latest debian image on bbb.

I have two PWM outputs; P9_22 and P9_42

After a period I need to shutdown pwm outputs (take them to low). As their is no function exposed to write a zero (0) to 'run' I have used recommendation to write a zero to dutycycle in analogWrite, for simple code example see:

var b = require('bonescript');
var pulseOutput = "P9_42";
b.analogWrite(pulseOutput, 0.5, 2000)
setTimeout(function(){
    b.analogWrite(pulseOutput, 0)
    }, 10000);

P9_42 output pin goes low as expected, but P9_22 doesn't - it has a 10nS spike every 500uS.

Manually writing zero to echo 0 > /sys/devices/ocp.3/bs_pwm_test_P9_22.16/run does work.

Any ideas/suggestions?

Would it be possible to expose disable/enable function in upcoming release?

Thanks
Colin

Copied from original issue: jadonk#88

@jadonk
Copy link
Member Author

jadonk commented Apr 25, 2018

From @colinbes on July 29, 2014 12:34

I was wondering if there was any feedback on this issue as I really need to shutdown the PWM output such that output is at a steady 0V?

@jadonk
Copy link
Member Author

jadonk commented Apr 25, 2018

From @adityapatadia on September 15, 2014 8:4

Try https://github.com/theoctal/octalbonescript It is fork of bonescript with a lot of improvements. And guess what? It has stopAnalog(pin, callback) function for your need. Test it and let us know.

@jadonk
Copy link
Member Author

jadonk commented Apr 25, 2018

From @colinbes on September 15, 2014 16:57

Thanks, I will take a look and let you know.

~C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants