IR Keys time changes
be80be
Posts: 56
I'm using a IR detector radio shack 273-640 It works but if i press a button like 1 it the pwm time is like 312 314 627 I press the same button again and the time changes 328 312 338 should it be the same .
I'm using the this program
' IR Remote for the Boe-Bot - RecordAndDisplayPwm.bs2
' Measure all data pulses from SONY IR remote set to control a TV.
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word(12) ' SONY TV remote variables.
index VAR Nib
' Display heading.
DEBUG "time ARRAY", CR,
"PWM MEASUREMENTS", CR,
"Element Duration, 2-us", CR,
"
"
DO ' Beginning of main loop.
DO ' Wait for rest between messages.
PULSIN 9, 1, time(0)
LOOP UNTIL time(0) > 1000
PULSIN 9, 0, time(0) ' Measure/store data pulses.
PULSIN 9, 0, time(1)
PULSIN 9, 0, time(2)
PULSIN 9, 0, time(3)
PULSIN 9, 0, time(4)
PULSIN 9, 0, time(5)
PULSIN 9, 0, time(6)
PULSIN 9, 0, time(7)
PULSIN 9, 0, time(8)
PULSIN 9, 0, time(9)
PULSIN 9, 0, time(10)
PULSIN 9, 0, time(11)
FOR index = 0 TO 11 ' Display 12 pulse measurements.
DEBUG CRSRXY, 0, 4 + index, "time(", DEC index, ")",
CRSRXY, 9, 4 + index, DEC time(index), CLREOL
NEXT
LOOP ' Repeat main loop.
thanks for input
I'm using the this program
' IR Remote for the Boe-Bot - RecordAndDisplayPwm.bs2
' Measure all data pulses from SONY IR remote set to control a TV.
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word(12) ' SONY TV remote variables.
index VAR Nib
' Display heading.
DEBUG "time ARRAY", CR,
"PWM MEASUREMENTS", CR,
"Element Duration, 2-us", CR,
"
"
DO ' Beginning of main loop.
DO ' Wait for rest between messages.
PULSIN 9, 1, time(0)
LOOP UNTIL time(0) > 1000
PULSIN 9, 0, time(0) ' Measure/store data pulses.
PULSIN 9, 0, time(1)
PULSIN 9, 0, time(2)
PULSIN 9, 0, time(3)
PULSIN 9, 0, time(4)
PULSIN 9, 0, time(5)
PULSIN 9, 0, time(6)
PULSIN 9, 0, time(7)
PULSIN 9, 0, time(8)
PULSIN 9, 0, time(9)
PULSIN 9, 0, time(10)
PULSIN 9, 0, time(11)
FOR index = 0 TO 11 ' Display 12 pulse measurements.
DEBUG CRSRXY, 0, 4 + index, "time(", DEC index, ")",
CRSRXY, 9, 4 + index, DEC time(index), CLREOL
NEXT
LOOP ' Repeat main loop.
thanks for input
Comments