More IF_THEN dumb questions.


Results 1 to 12 of 12

Threaded View

  1. #10
    Join Date
    Dec 2003
    Location
    Storrs, Ct.
    Posts
    91


    Did you find this post helpful? Yes | No

    Lightbulb an easier way?

    After confusing myself a little I came up with this,

    Code:
    checkrelays:
            select case myinput
                case 1,3,16,66          'manual and auto pulse on day and night
                   high relay1 : pause pulsetime : low relay1
                case 5,7,20,70          'manual and auto hold on day and night
                   high relay1 
                case 8,10,40,138       'manual and auto pulse off day and night
                   high relay2 : pause pulsetime : low relay2   
                case 12,14,44,142      'manual and auto hold off day and night
                   low relay1
               end select
               return
    This seems to cover all my possible cases, however this is for one relay, I have 8 to test.


    After filling MYINPUT the first time the only bits that need to be changed for the next relay are:
    myinput.1, myinput.2, myinput.3, and then the relays to act on, IE relay2, relay3, etc....

    Is there a better way to do this or just write a seperate case select for each relay?

    Thanks for any input!
    Last edited by ronjodu; - 22nd February 2005 at 00:41. Reason: Back to the drawing board.

Similar Threads

  1. Olympic Timer
    By Melanie in forum Code Examples
    Replies: 47
    Last Post: - 17th September 2008, 20:46
  2. Two quick (and elementary) questions.
    By scorpion990 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th June 2008, 00:03
  3. A few 12F683 questions
    By dhouston in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 24th May 2008, 04:54
  4. Usart Questions
    By shawn in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2008, 02:17
  5. Still new to PicBasic - i2c questions
    By cometboy in forum mel PIC BASIC
    Replies: 4
    Last Post: - 13th November 2006, 19:27

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