10,20,30,40 minutes


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Posts
    3

    Default 10,20,30,40 minutes

    Hello,

    I Have a pic16f628 with 4 connected buttoms to RB0..RB3 and 4 connected leds to RB4... RB7 every time that presses a button I want that temporize the first led 10 minutes and concluded the time fades, the second led 20 minutes and concluded the time fades, the third led 30 minutes and concluded the time fades and the fourth led 40 minutes and concluded the time fades.

    Can somebody give me an example of as making it?

    Helena

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by helena View Post
    Hello,

    I Have a pic16f628 with 4 connected buttoms to RB0..RB3 and 4 connected leds to RB4... RB7 every time that presses a button I want that temporize the first led 10 minutes and concluded the time fades, the second led 20 minutes and concluded the time fades, the third led 30 minutes and concluded the time fades and the fourth led 40 minutes and concluded the time fades.

    Can somebody give me an example of as making it?

    Helena
    Show us an example of what YOU think might work...we can then have a base to work WITH you and not FOR you.

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Helena,

    Skimask is right.

    There are many people looking for ready-cooked cake around here.

    Here is some hints for you to show us whether you can do something on your own and continue on this code.

    Code:
    Btn1   VAR PORTB.0      'First Button
    Led1   VAR PORTB.4      'First Led
    TenMin CON 100          'A constant value for Ten-Minute timing condition.
    TIME   VAR WORD         'Variable for Timing   
    
    IF Btn1 = 0 THEN
       WHILE Btn1=0 : WEND    'Wait for finger release.
       TIME = TenMin          'Set initial timing value.
       HIGH Led1              'Activate first LED.
       WHILE TIME > 0         'Set a timing condition.
          PAUSE 6000          'Wait for 6 second.
          TIME = TIME - 1     'Decrement "initial" timing value.
       WEND                  'Total of TenMin*6000ms passed; 600,000ms = 10minutes.
       LOW Led1               'De-Activate first LED.  
    ENDIF
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Jan 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Hello sayzer,

    With this help that you give me I can already have an idea but general.

    Thank you

    Helena

Similar Threads

  1. Virtual LED Clock For Windows By Trent Jackson
    By T.Jackson in forum Code Examples
    Replies: 8
    Last Post: - 10th November 2009, 09:20
  2. Freeze the communication after 30 minutes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd May 2009, 08:46
  3. after five months the clock is early 30 minutes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd April 2009, 19:23
  4. Hour and minutes
    By Leonardo in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 8th February 2007, 04:50
  5. turn off PIC after few minutes ??
    By micro in forum General
    Replies: 1
    Last Post: - 6th March 2006, 18:08

Members who have read this thread : 1

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