'**************************************************************** '* Name : PULLUP_PortA4.pbp * '* Author : Francisco Polonio Armada * '* Notice : Copyright (c) 2019 '* Date : 04/01/2019 * '* Version : 1.0 * '* Notes : PIC16F628A * '* : * '**************************************************************** #CONFIG __CONFIG _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF #ENDCONFIG '------------------------------------------------------------------------------- CMCON = 7 'No se usan los comparadores analógicos. TRISA=%00000111 TRISB=%00000000 PortB=%00000000 PortA=0 '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- symbol Boton1 = PortA.0 symbol Boton2 = PortA.1 Symbol Led_01 = PortA.3 Symbol Led_02 = PortA.4 '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- '------------------------------------------------------------------------------- Main: '-------------------------------------------------------------------------
'Mientras el botón esté pulsado el led parpadea . while boton1 = 0 ' con resistencia PullUP Led_01= not Led_01 pause 100 wend 'Mientras el botón esté pulsado el led parpadea . while boton2 = 1 ' con resistencia PullDOWN Led_02= not Led_02 pause 100 wend goto Main '---------------------------------------------------------------------
'------------------------------------------------------------------------------- '------------------------------------------------------------------------------- end