Define CONF_WORD = 0x2f50
Define CONF_WORD_2 = 0x3ffd
Define CLOCK_FREQUENCY = 4 'define osc 4
'PIC16F88
'///////////////////// Configuro puertos/////////////////////////
AllDigital
TRISA = %11111
TRISB = %00000000
PORTB = 0
'//////////////////////////////////////////////////////////////
main:
'inicio1:
'Input PORTA.0
If PORTA.0 = 1 Then Gosub luz1
'Else
'Goto inicio1
'Endif
'inicio2:
'Input PORTA.1
If PORTA.1 = 1 Then Gosub luz2
'Else
'Goto inicio2
'Endif
Goto main
End
'Sub-rutinas
luz1:
PORTB.0 = 1
WaitMs 10 'pause 10
Return 'goto luz1
luz2:
PORTB.1 = 1
WaitMs 10 'pause 10
Return 'goto luz2
'End
'este ejemplo son dos pulsadores, que con el RA0, es = 1 si se cumple esa condicion salta a luz1.
'hasta ahi anda, bien pero cuando voy a pulsar el otroo, no me responde o sea no salta a la etiqueta luz2.