terça-feira, 19 de agosto de 2014

Contador Com PIC16F628A

'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : César Morisco                                     *
'*  Notice  : Copyright (c) 2014 Centraltek LTD                 *
'*          : All Rights Reserved                               *
'*  Date    : 19/8/2014                                         *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
define osc 4 
INCLUDE "modedefs.bas"
CMCON=7
TRISB=00 
TRISA= %1000 
X VAR BYTE 
Y VAR BYTE 
R VAR BYTE 
main:
IF porta.3 = 0 then
pause 150
endif
 if porta.3 = 0 then inicio
goto main
INICIO: 
FOR X=2 TO 0 step -1
    FOR Y=9 TO 0 step -1 
          FOR R=1 TO 50 
                         
                      
PORTA=1 
PORTB=X 
PAUSE 10
PORTA=%010 
PORTB=Y 
PAUSE 10 
NEXT 
NEXT 
NEXT 
IF (X=0) AND (Y=0) THEN X=0:Y=0
GOTO CERO 
GOTO INICIO 

CERO: 

FOR X=0 TO 0 
    FOR Y=0 TO 0 
          FOR R=1 TO 50
                         
                        
PORTA=1 
PORTB=X 
PAUSE 10 
PORTA=%010 
PORTB=Y 
PAUSE 10 
NEXT 
NEXT 
NEXT 
IF (X=0) AND (Y=0) THEN X=0:Y=0
high portA.2
Pause 50
GOTO main
if portA.2 =1 then end

end

Nenhum comentário:

Postar um comentário