Loop issues


Results 1 to 19 of 19

Thread: Loop issues

Threaded View

  1. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Loop issues

    Side question - these nesting of IF-THEN are used to avoid usage of AND/OR operators?

    or even a little binary arithmetic

    Code:
    if PortB.0 = 0 then
    if PortB.1 = 1 then
    if PortB.4 = 1 then
    runtime = 60
    endif
    endif
    endif
    
    
    if PortB.0 = 1 then
    if PortB.1 = 1 then
    if PortB.4 = 1 then
    runtime = 90
    endif
    endif
    endif
    
    
    if PortB.0 = 1 then
    if PortB.1 = 0 then
    if PortB.4 = 0 then
    runtime = 120
    endif
    endif
    endif
    shrinks to
    Code:
    if PortB&19 == 18 then
    runtime = 60
    elseif PortB&19 == 19 then
    runtime = 90
    elseif PortB&19 == 1 then
    runtime = 120
    endif

    with regard to the loop

    if SSW = 1 then ???????????? what is ssw

    snippets are a total failure as usual

    could be the pin if its a pin is still set to analog
    Last edited by richard; - 24th September 2021 at 07:35.
    Warning I'm not a teacher

Similar Threads

  1. Do Loop
    By skybox in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th December 2012, 00:45
  2. Issues with a feedback loop.
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th June 2012, 18:54
  3. if ... then loop
    By lerameur in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th November 2010, 23:08
  4. Help with loop
    By wildbilly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd January 2007, 16:59
  5. While LOOP
    By actionplus in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 5th March 2004, 14:59

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