Page 1 of 1

PWMParabola

Posted: Wed Sep 05, 2012 12:17 pm
by DrewPalmer04
Is it possible to use the PWMParabola or PWMSlope for pinMode(lowATOPin,OUTPUT); ? This would be for use for the idea of controlling a meanwell P series driver from 0-5v from the lowATOPin.

Re: PWMParabola

Posted: Wed Sep 05, 2012 1:02 pm
by rimai
Yes, you can do this:

Code: Select all

analogWrite(lowATOPin,2.55*PWMSlope(7,0,19,0,0,100,60,0));
PWMSlope or PWMParabola returns a value between 0 and 100%.
So, you just need to multiply by 2.55 before passing on to the analogWrite function.

Re: PWMParabola

Posted: Mon Sep 10, 2012 7:50 pm
by DrewPalmer04
Any way to display the % for the output for this on a custom main?

Re: PWMParabola

Posted: Mon Sep 10, 2012 8:00 pm
by rimai
Yeah, you can just draw the same thing:

Code: Select all

ReefAngel.LCD.Drawtext(0,255,10,10,PWMSlope(7,0,19,0,0,100,60,0));