ADCIN query


Closed Thread
Results 1 to 3 of 3

Thread: ADCIN query

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    muddy0409, Try this...

    case is >133
    portb = %00000000
    goto finish
    case is<134 '108
    portb = %00000001
    goto finish

    I have to ask though, Why are you using all of the "goto finish" statements? The case statement takes care of that for you.. The code would run faster with out them...

    Dave Purola,
    N8NTA

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Peter

    isn't that a Typo ???

    Code:
    case is<133 '108
    Cause the written code matches to what you describe ...

    so, Try this one :

    Code:
    start:
    
    adcin 1, instate
    
    select case instate
    
    case is>220 'actual is 248
    portb = %00010000
    
    case is>190 'actual is 201
    portb = %00001000
    
    
    case is>162 '178
    portb = %00000100
    
    
    case is> 139 '154
    portb = %00000010
    
    
    case is >132 '136
    portb = %00000001
    
    
    case ELSE '108
    portb = %00000000
    
    end select
    
    pause 20
    goto start
    Here, leds will be off for Open input ... if divider present on input !

    Alain

    PS ... I suppose you mix "break" C statement with PbP " go to Finish " ... lol : PbP do not [no]need[no] have it !!!
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. ADCIN and PIC18F4331 Arghhhhh !
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th December 2010, 20:27
  2. How to make adcin stable?
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th January 2009, 07:41
  3. ADCIN Problem
    By JavPar in forum General
    Replies: 33
    Last Post: - 20th January 2009, 03:36
  4. Adcin or Pot
    By lerameur in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 11th January 2007, 16:46
  5. help using adcin
    By harryweb in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st January 2006, 07:46

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