Increasing M106 S value in a macro incrementaly
-
I am trying to change the brightness of my LED strip slowly to a preset value.
Using M106 P3 and increase the S value in increments.
This is the macrowhile fans[3].actualValue < 40
M106 P3 S^fans[3].actualValue + 2
; {Sfan[3].requestedValue} = {Sfan[3].actualValue} + 2
G4 S5 ;Wait for 5 second
echo "LED Red Requested value = " ^ fans[3].requestedValue
echo "LED Red Actual value = " ^ fans[3].actualValueError M106: expected string expression
Is this possible?
-
@appjaws said in Increasing M106 S value in a macro incrementaly:
M106 P3 S^fans[3].actualValue + 2
Try:
M106 P3 S{fans[3].actualValue + 2}
In any standard GCode command (not meta command like 'if' or 'while'), if you want to use an expression as a parameter value, you must enclose the expression in { }.
-
@dc42 said in Increasing M106 S value in a macro incrementaly:
M106 P3 S{fans[3].actualValue + 2}
Thanks, great answer, I am learning a lot.