Trouble pulling pin Low


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    take a look where the goto command is... so it jumps only to the loop marker if your condition is true!

    if portb.1 = 0 then the programms doesn't execute the lines between if and endif and jumps to the next command after endif. probaply there is nothing or only an end command. which finish the programm.

    take this structure :

    loop:
    if portb.1 = 1 then ' only when condition is true
    low portb.4
    pause 200
    high portb.4
    endif

    goto loop ' infinity

    end

  2. #2
    Join Date
    Jul 2005
    Posts
    65


    Did you find this post helpful? Yes | No

    Lightbulb

    Hello

    You may want to try this too:

    DEFINE OSC 4 ' 4 MHz Crystal

    TRISB.4 = 0
    PORTB.4 = 1

    WHILE 1
    IF PORTB.1 == 1 THEN
    PULSOUT PORTB.4, 20000 ' Generates accurate 200 ms High-Low-High pulse
    ENDIF

    WEND ' Infinitly repeat this loop

    END

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 14:55
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 16:23
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 18:27
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 18:07
  5. 4-line LCD Help - using PortA instead of B
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 31st March 2005, 04:14

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