About timing in pic basic pro


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2007
    Posts
    8

    Question About timing in pic basic pro

    Dear all,

    My program :

    PortA.0 = input
    PortB.0 = Output 1
    PortB.0 = Output 2

    I want to check condition for the PortA.0

    If PortA.0 = high, PortB.0 will set high. ( PortA.0 will be check for 30 second only, if
    portA.0 still = low after 30 second PortB.1 will high.)

    some body can help me how to program for this situation.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, something is not clear in your explanation....

    When you said, "PORTA.0 will be check for 30 second only" once PORTA.0=1 on or once you put the power on your PIC?

    Let's say once your put the power on your pic...
    Code:
            TRISA = 255
            TRISB = 0
            CounterA    VAR WORD
            PB          var PORTA.0
            OUT1        VAR PORTB.0
            OUT2        VAR PORTB.1
            
            PORTB = 0       ' Clear all leds
            CounterA = 0    ' Clear counter
    Start:
            while (CounterA<300) AND (PB=0)
                pause 100
                CounterA = CounterA + 1            
                wend
            
            if CounterA>=300 then
                OUT2 = 1
                else
                    OUT1 = 1
                endif
                
    Spin:   GOTO Spin
    Last edited by mister_e; - 4th October 2007 at 02:37.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Oct 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Smile Thank you

    Dear mister_e,

    Thank you for your suggestion,
    I try follow your methode in my program,

Similar Threads

  1. Looking at pic basic pro symbol values in mplab 8.15a simulator
    By ukemigrant in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 16th May 2009, 13:18
  2. I want to buy PIC BASIC PRO...
    By simransingh in forum General
    Replies: 2
    Last Post: - 30th October 2007, 17:13
  3. PIC BASIC or PIC BASIC PRO
    By kirkmans in forum USB
    Replies: 3
    Last Post: - 20th April 2007, 00:52
  4. Replies: 5
    Last Post: - 17th January 2006, 19:26
  5. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07

Members who have read this thread : 1

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