PDA

View Full Version : 10,20,30,40 minutes



helena
- 1st March 2007, 01:30
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

skimask
- 1st March 2007, 01:40
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.

sayzer
- 1st March 2007, 07:33
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.



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

helena
- 1st March 2007, 12:04
Hello sayzer,

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

Thank you

Helena