Automatic turn off


Closed Thread
Results 1 to 23 of 23

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I ended up using a SPST switch on mine....

    They sell these dirt cheap all over the place... with 20 MILLs and less to operate...

    I put the switch to make contact across the Terminals, and as soon as the contact is made, the PIC stuck 20 mills across the load to keep it on. The you can do whatever you want....and the PIC will turn it off 100 percent. run 3 1.5 volt batterys and presto...

    Attached is a image... Please do admire my artistic abilities...<chuckle>

    Dwayne
    Attached Images Attached Images  
    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...

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

  3. #3


    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

  4. #4
    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 19: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...

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Leonardo,

    See your other post in the General forum.

  6. #6
    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, 20:19
  2. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 22:27
  3. Help with PIC project
    By davekav in forum General
    Replies: 3
    Last Post: - 17th April 2008, 23:15
  4. Interface for 16f818
    By davekav in forum Serial
    Replies: 4
    Last Post: - 17th April 2008, 11:33
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02: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