In SX Microcontrollers, SX/B Compiler and SX-Key Tool, danny.gonzales wrote: Hello all! I am using PWMLEDs by JohnnyMac to control my RGB led and want to get a smooth transition from one color to the other. The program turns off each color at end of pwm. A section of the program code is shown below: FOR brightness = 0 to 254 level1 = brightness DELAY_MS 20 NEXT FOR brightness = 255 to 0 STEP -1 'I adjusted this to 255 to 20 STEP -1 level1 = brightness DELAY_MS 20 NEXT Adjustment made a smooth transition from color to color, however, because the step was not all the way to 0, it did not turn the led completely off, thus I donot get a pure color. I added an extra IF-ENDIF statement to completely turn off the LED but the action was not pleasant. While the current LED increases in brightness, one can see the abrupt turning off of the previous LED. I would appreciate suggestions to achieve smooth transition from color to color with 1st LED fading out completely while the 2nd LED fades in with no complete blackout during the transition. My advance thanks. Danny ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=338503 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)