Automatic turn off


Results 1 to 23 of 23

Threaded View

  1. #14
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello leonardo,

    I think I understand what you are trying to do... Try this...This is assuming your previous code compiles... I do not have PB, I only have PBP.

    Dwayne

    Code:
    'code
    
    Symbol Mi = B0
    Symbol Se = B1
    
    TOP:
    Dir2 = 1 ' make Pins 2 and 1 outputs
    Dir1 = 1
    
    Pin2 = 0 ' turn on lamp - 1 minute
    For Mi = 1 to 1 'minutes
    For Se = 1 to 60 ' seconds
    Pin1 = 1 ' test LED
    Pause 500
    Pin1 = 0
    Pause 500
    Next
    Next
    
    Pin2 = 1 ' turn lamp on - on for 1 minute
    
    For Mi = 1 to 1 ' minutes
    For Se = 1 to 60 ' seconds
    Pin1 = 1
    Pause 500
    Pin1 = 0
    Pause 500
    Next
    Next
    
    GoTo TOP

    Try something like this:

    Code:
    'code
    
    Symbol Mi = B0
    Symbol Se = B1
    
    TOP:
    Dir2 = 1 ' make Pins 2 and 1 outputs
    Dir1 = 1
    
    Pin2 = 0 ' turn off lamp -  1 minute
    Pin1 = 1' Turn on Lamp 
    For Se = 1 to 60 ' seconds
    Pause 1000
    Next
    
    Pin2 = 1 ' turn lamp on - on for 1 minute
    Pin1=0 'turn Lamp off for 1 minute.
    
    For Se = 1 to 60 ' seconds
    Pause 1000
    Next
    
    GoTo TOP
    Last edited by Dwayne; - 21st September 2005 at 20:22.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 21:19
  2. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 23:27
  3. Help with PIC project
    By davekav in forum General
    Replies: 3
    Last Post: - 18th April 2008, 00:15
  4. Interface for 16f818
    By davekav in forum Serial
    Replies: 4
    Last Post: - 17th April 2008, 12:33
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

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