In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Phil, The easiest way would be to just connect the four buttons to four pins and the other side of the button to ground. Then use the internal pullup resistors. One thing that you have to watch is when you change R1 or R2, if the counter is already past the new setting, the timer will have to wrap-around before it changes state. For example let's say the old R1 value was 1000, and the timer is currently at 700, the new R1 is 500. When you set the new R1 the counter will have to wrap-around past 65535 and back to 500 before the PWM turns off. There are two ways to handle this. One is to clear the timer when you update R1 and R2. The other is to wait until the timer matches R2, then change R1 and R2. Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=318599#m318787 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)