Automatic turn off


Closed Thread
Results 1 to 23 of 23

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    i hope one day i'll be able to do nice schematic like that. I really need to trash my P-Cad and use your software instead
    Steve

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

  2. #2


    Did you find this post helpful? Yes | No

    Smile Question

    Hello mister E

    I am using PICBASIC COMPILER 1,45 and the following one I cosay does not work, I want to me to ignite the LED in pin2 by 1 minute and as soon as another minute is extinguished and continue the sequence but does not work to me, some suggestion.

    I am using a PIC12F675.

    Thanks


    'code

    Symbol Mi = B0
    Symbol Se = B1

    TOP:
    Dir2 = 1 ' make Pins 2 and 1 outputs
    Dir1 = 1

    Pin2 = 0 ' turn off lamp - off or 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







    Quote Originally Posted by mister_e
    i hope one day i'll be able to do nice schematic like that. I really need to trash my P-Cad and use your software instead

  3. #3
    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...

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Leonardo,

    See your other post in the General forum.

  5. #5
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Pin 0 & 1 are comparators by default

    You need to change their mode as part of your a setup

    Try:

    poke $19, $7 'to disable comparator mode for pins 0 & 1

    See the manual regarding these pins as comparators.

    When used as comparators, the 12f629/75 make a great op-amp. It is on or off, no slope, and the turn on can be "smart. I made an "on at dark" light switch that stays on only 4 hours.

    AMay

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