newbe: IF..THEN statement


Results 1 to 5 of 5

Threaded View

  1. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Since the three inputs are all on the same port, then you can tray:

    A0 var BYTE

    A0 = PortA.0 + PortA.1 + PortA.2

    If A0 > 2 then PortB.0 = 1

    or.....

    IF PortA & %00000111 > 2 then portB.0 = 1

    Al.
    Last edited by aratti; - 11th November 2009 at 01:07.
    All progress began with an idea

Similar Threads

  1. 16F883 and Problems with HIGH statement
    By aaanekre in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th October 2009, 01:09
  2. END Statement
    By jderson in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th November 2008, 14:48
  3. ADC_IN statement
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th April 2007, 10:15
  4. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  5. getting around the basic IF - THEN statement
    By dw_pic in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th February 2006, 14:10

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