simple newb question


Results 1 to 14 of 14

Threaded View

  1. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I change some things in your code

    Code:
    trisb.0=1 ' sets input for servo signal
    ServoInput VAR PORTB.0
    
    trisb.1 = 0 ' Set RB1 as output
    rled VAR PORTB.1 ' BIND OUTPUT TO RB1
    
    trisb.2 = 0 ' set RB2 as output
    lled VAR PORTB.2
    
    ' PS : we can also define TRIS in one shot
    ' TRISB = 1   
    ' in the above, only B0 is an input
    
    Start:
    
    rled = 0 ' right leds off
    lled = 0 ' left leds off
    
    Select Case ServoInput
         Case 1
              rled = 1 ' right side led on
              pause 250 ' pause 1/4 second 
              rled = 0 ' right side led off
              pause 250 'pause off
    
         Case 0
              lled = 1 'left side led on 
              pause 250 'pause 1/4 sec
              lled = 0 ' left led off
              pause 250 'pauses off for 1/4 sec 
    end select
    
    goto start
    Last edited by mister_e; - 4th February 2005 at 20:32.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Newb Question...
    By Perrin` in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd January 2009, 20:49
  2. Really simple question for you experts :)
    By lew247 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th June 2008, 01:43
  3. SIMPLE question
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th February 2008, 18:27
  4. really simple, dumb question
    By picster in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd March 2007, 22:02
  5. really simple adcin question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 21st April 2006, 09:06

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