If you want to adjust the minimum brightness, simply change the value of minFadeValue it's currently set to what I quoted (10), not to what your fade code had (20). If (fadeValue >= 255 || fadeValue <= minFadeValue) If (fadeValue >= 255 || fadeValue = nextTime) if over maximum or minimum reached, change the 'direction' If (fadeValue >= 255 || fadeValue = 255 || fadeValue = nextTime) if maximum or minimum reached, change the 'direction' update the brightness for the next time the brightness levelĪnd in loop() use that variable. We use a variable fadeStep that will be positive to increase the brightnes and negative to decrease the brightness. If this is clear to you, we can add the decreasing of the brightnes back into this code. ![]() ![]() int fadeValue įor demonstration, we will just use the first for-loop and leave the second for-loop out of the equation. As you haven't shared your code, below will probably be more or less what your fade code looks like.
0 Comments
Leave a Reply. |