encoder port change


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Henrik shared some code here that may give you an idea or two.
    http://www.picbasic.co.uk/forum/showthread.php?t=11683
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    153


    Did you find this post helpful? Yes | No

    Default encoder

    Thank you I also did a search (dah) of the fourm and found that if I & the two bits it will give direction I will look all this over and repost if I don't get it.

    thanks again

  3. #3
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    153


    Did you find this post helpful? Yes | No

    Default encoder

    Just so I don't mess anyone up here,This is what will work for me.

    Using Xor will give direction.

    take the righthand bit of your old value xor it with the lefthand bit of the new value.

    if your xor value is 0 the knob is turning clockwise
    if your xor value is 1 the knob is turning counter_clockwise

Similar Threads

  1. Quadrature encoder and ASM Interrupts. questions..
    By godfodder in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th March 2013, 14:45
  2. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  3. Using PICBASIC PRO in MPLAB IDE
    By jblackann in forum General
    Replies: 8
    Last Post: - 4th May 2008, 09:20
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. encoder wowes
    By wallaby in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 6th December 2005, 21:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts