PBP projects for R/C models


Results 1 to 40 of 772

Threaded View

  1. #24
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Serious PULSIN problem

    Ladies and Gentlemen:

    My project and I have a problem. PULSIN is putting zero into its target register even though my PICkit 2 LOGIC TOOL sees a reasonable pulse. See picture, below.

    It is happening on the inputs from both SRF05 proximity detectors. My code, below, looks for zero and blinks some LED's if it sees a zero. They blink on the very first proximity tests.

    Any suggestions? Is my code incorrect? Are there vulnerabilities or idiosyncrasies of which I should be aware?
    symbol trigright = PORTB.0 ' Define output pin for Trigger pulse
    symbol trigfront = PORTB.1 ' Define output pin for Trigger pulse

    symbol echoright = PORTB.2 ' Define input pin for Echo pulse
    symbol echofront = PORTB.3 ' Define input pin for Echo pulse

    puls:
    GOSUB blinkloop0
    DEFINE PULSIN_MAX 65535
    pulsout trigright,2 ' produce 20uS trigger pulse (must be minimum of 10uS)
    pulsin echoright,1,rangeright ' measures the range in 10uS steps

    pulsf:

    pulsout trigfront,2 ' produce 20uS trigger pulse (must be minimum of 10uS)
    pulsin echofront,1,rangefront ' measures the range in 10uS steps
    pause 10 ' recharge period after ranging completes

    '*****test for zeros******
    IF rangeright = 0 then
    gosub blinkloop45
    endif
    if rangefront = 0 then
    gosub blinkloop67
    endif
    return
    Attached Images Attached Images  

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 13:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 12:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 20:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th December 2005, 00:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 17:24

Members who have read this thread : 2

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