counter for counting magnetic microswich press


Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Mar 2006
    Location
    Ankara -Turkey
    Posts
    27

    Default counter for counting magnetic microswich press

    Hi Everyone.
    I want to count microswich open-close positon to count disk rotation.
    ı have a micro magnetic swich which is produce 2 signal when maghnetic disc rotating 1 time.magnetic swich debounce time is 20 uSec.
    I use Pic16F877
    This is my code:

    ..PORTA.4 input pin...
    ........
    ..........
    loopHy:
    IF PORTA.4 = 0 THEN loopHy
    count = count+50
    Lcdout $fe, $C0, #count:Pause 250(debounce time for slow rotation)
    goto loopHy
    ........

    is it Ok .or anybody give me advise.
    Thanks.
    Last edited by turkuaz; - 16th June 2007 at 10:55.

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. 20 Digit Virtual LED Counter
    By T.Jackson in forum Code Examples
    Replies: 9
    Last Post: - 19th November 2007, 05:02
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. How to set TMRO & TMR3 as Counter?.
    By NatureTech in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 18th May 2007, 08:52
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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