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

PWM polarity is sometimes inverted. #37

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

PWM polarity is sometimes inverted. #37

jadonk opened this issue Apr 25, 2018 · 2 comments

Comments

@jadonk
Copy link
Member

jadonk commented Apr 25, 2018

From @cautiousCentaur on April 17, 2016 1:53

I have this error when initializing an object method that calls analogWrite. It causes my logic to be inverted so that 1 means off, and 0 means on. It only happens sometimes, so I can't simply change the logic.

self.Dim = function(amount){
bone.analogWrite(self.pin, (amount));
self.state = amount;
}
self.Dim(0.0);

Sunset_dim = new GrowSwitch("P8_13",1,true);
error: Error enabling PWM controls: Error: ENOENT, no such file or directory '/sys/devices/ocp.3/bs_pwm_test_P8_13.21/polarity'
info: Error enabling PWM controls: Error: ENOENT, no such file or directory '/sys/devices/ocp.3/bs_pwm_test_P8_13.21/polarity'
error: error updating PWM freq and value: /sys/devices/ocp.3/bs_pwm_test_P8_13.21, Error: ENOENT, no such file or directory '/sys/devices/ocp.3/bs_pwm_test_P8_13.21/duty'
{ pin: 'P8_13',
active: 1,
isPWM: true,
state: 0,
Dim: [Function] }

Copied from original issue: jadonk#122

@jadonk
Copy link
Member Author

jadonk commented Apr 25, 2018

Can you try performing a b.pinMode('P8_13', b.ANALOG_OUTPUT); ahead of making any b.analogWrite() attempts? Also, any chance you can try a 4.4.x kernel and 0.5.0-betaX BoneScript?

@jadonk
Copy link
Member Author

jadonk commented Apr 25, 2018

From @cautiousCentaur on June 25, 2016 6:20

setting pinMode did not work consistently. Is it a synchronous function? At this time I cannot try newer versions because it's taken some time to make everything else compatible. I don't want to break other things.

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

No branches or pull requests

1 participant