In SX Microcontrollers, SX/B Compiler and SX-Key Tool, robotworkshop wrote: Your right about the since it is checking bit 3 for a change. It shouldn't be checking that bit. It should be checking 1 as in the example encoder application. The problem is that the program as written isn't consistent about bit locations. I guess another way to to it (if the encoders are wired to RA.0 and RA.1 would be to do something like this at the beginning: EncodersNew = EncodersNew << 2 ' Shift over to perform all calculations EncodersNew = EncPort & &00001100 ' Mask off extra bits There are a lot of ways to do it but it just needs to be consistent throughout the code. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=259381#m259493 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)