Hello, I feel much to bother Mellanie but until now I am learning to use the PBP and I need to make these questions to be everything an expert in PBP as you are it.
What attempt is the following thing:
When sw1 is on to timer by 3 seg digit to number 1
When sw2 is on to timer by 6 seg digit to number 2
When sw3 is on to timer by 8 seg digit to number 3
If when igniting pic is other pin in 0 then shows it immediately according to his I number, but if all sw1, sw2, sw3 are 0 they are in delay to timer. Also I want that when anyone of the digit ignites this seg does blink 1.
Thanks again
Code is:
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 16/08/05 *
'* Version : 1.0 *
'* Notes :FOR PIC16F628, *
'* : USE PBP *
'************************************************* ***************
SYMBOL LED1 = PORTB.0 'PIN 6
SYMBOL LED2 = PORTB.1 'PIN 7
SYMBOL LED3 = PORTB.2 'PIN 8
SYMBOL LED4 = PORTB.4 'PIN 9
SYMBOL SW1 = PORTA.0 'PIN 17
SYMBOL SW2 = PORTA.1 'PIN 18
SYMBOL SW3 = PORTA.2 'PIN 1
LOW LED1
LOW LED2
LOW LED3
LOW SW1
LOW SW2
LOW SW3
TRISA = 1 'PUERTO A COMO ENTRADAS
TRISB = 0 'PUERTO B COMO SALIDAS
LOOP0:
IF SW1 = 0 AND SW2 = 0 AND SW3 = 0 THEN LOOP
IF SW1 = 1 AND SW2 = 0 AND SW3 = 0 THEN LOOP1
IF SW1 = 1 AND SW2 = 1 AND SW3 = 0 THEN LOOP2
IF SW1 = 1 AND SW2 = 1 AND SW3 = 1 THEN LOOP3
LOOP:
IF SW1 = 1 THEN
PAUSE 3000
PORTB = %00000110 'DIGIT NUMBER 1
ENDif
IF SW2 = 1 THEN
PAUSE 6000 'TIMER 10 SEG
PORTB = %01011011 'DIGIT NUMBER 2
ENDIF
IF SW3 = 1 THEN
PAUSE 8000
PORTB = %01001111 DIGIT NUMBER 3
ENDIF
GOTO LOOP
LOOP1:
PORTB = %00000110 ' DIGIT NUMBER 1
GOTO LOOP1
LOOP2:
PORTB = %01011011 'DIGIT NUMBER 2
goto LOOP2
LOOP3:
PORTB = %01001111 'DIGIT NUMBER 3
GOTO LOOP3
GOTO LOOP0
Originally Posted by Melanie
Bookmarks