Hello All,
Controlling timer with few buttons using darreltaylor's Elapsed Timer Routines perfectly, Would like to control wirelessly with the use of a normal TV-remote-control with the RC5 protocol..seeking help..Thanx.
Some thing like this:
Main:
if command = 1 then start timer
if command = 2 then stop timer
if command = 3 then toggle led
goto Main

Current Code:
define osc 4
INCLUDE "DT_INTS-14.bas"
INCLUDE "ReEnterPBP.bas"
INCLUDE "Elapsed_INT.bas" ; Elapsed Timer Routines

TRISB = %11111111
PushButton var PortB.0
DIPSwitch var PortB.1
Switch1 var PortB.2
Switch4 var PortB.3
LED var portd.3
LED1 var portd.2
Low LED
low led1

'TRISE = %00000111
' Set LCD Data port
DEFINE LCD_DREG PORTD
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTD
' Set LCD Register Select bit
DEFINE LCD_RSBIT 1
' Set LCD Enable port
DEFINE LCD_EREG PORTD
' Set LCD Enable bit
DEFINE LCD_EBIT 0
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 50

LCDOUT $FE, 1, "Hello" ' Clear display and show “Hello”

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ClockCount, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

@ INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts

GOSUB ResetTime ' Reset Time to 0d-00:00:00.00
GOSUB StartTimer ' Start the Elapsed Timer

Main:
If PushButton=0 then GOSUB ResetTime ' Check for Button Press
While PushButton=0 : Wend
If Switch1 =0 then GOSUB StartTimer ' Check for Button Press
While Switch1 =0 : Wend
If DIPSwitch=0 then GOSUB StopTimer ' Check for Options
While DIPSwitch=0 : Wend
If Switch4 =0 then GOSUB tog ' Check for Button Press
IF SecondsChanged = 1 THEN
SecondsChanged = 0
LCDOUT $FE,2, DEC Days,"d-",DEC2 Hours,":",DEC2 Minutes,":",DEC2 Seconds

If Seconds > 0 And Seconds = 5 Then High LED1
If Seconds > 5 And Seconds = 10 Then Low LED1 : Seconds = 0
ENDIF
GOTO Main

tog:
Toggle LED ' Toggle LED at each Button Press
pause 250
return