Hello all
I first posted this request for help 01-10-2009.for PICAXE 18X (infrain).
Quote "I am trying to create a programe, to use with infra-red , so that when I press the transmmiter(TV remote) button the output goes high ,and remains high ,so long as I keep the button pressed, and when I take my finger off, the button the output goes low. A bit of code would be a big help,thanks."Unquote.
Hippy Kindly posted this code in reply ,its great I use it with 18X .
I would like to use similar code with Picaxe20X2.
I have played with the info on page2--121 irin (help! )
A bit of code for 20x2 would be much appreciated.
------------------------
To replace an infrain / infrain2 command with irin use these two lines:
symbol infra = b13 ; define an infra variable
irin C.0, infra ; read input C.0 into infra
-------------------------
-------------------------
'Picaxe 18X
'Infrared Latched
'Once an IR command is seen the IR line itsself(active low, 0= IR present) is
'monitored untill no IR is seen for a certain time.
'W0 is a timeout which either increments(pin0=1, no IR),or is reset to 0
'(pin0=0,IR present).
'The timedout value (1000) will likely need tobe changed to get the responce desired.
Do
Do
infrain
Loop Until infra=1
High 2
w0=0
Do
w0=w0+1 * pin0 '* Multiply or (returns low word of result)
Loop Until w0>30
Low 2
Loop
Thanks Ernie
I first posted this request for help 01-10-2009.for PICAXE 18X (infrain).
Quote "I am trying to create a programe, to use with infra-red , so that when I press the transmmiter(TV remote) button the output goes high ,and remains high ,so long as I keep the button pressed, and when I take my finger off, the button the output goes low. A bit of code would be a big help,thanks."Unquote.
Hippy Kindly posted this code in reply ,its great I use it with 18X .
I would like to use similar code with Picaxe20X2.
I have played with the info on page2--121 irin (help! )
A bit of code for 20x2 would be much appreciated.
------------------------
To replace an infrain / infrain2 command with irin use these two lines:
symbol infra = b13 ; define an infra variable
irin C.0, infra ; read input C.0 into infra
-------------------------
-------------------------
'Picaxe 18X
'Infrared Latched
'Once an IR command is seen the IR line itsself(active low, 0= IR present) is
'monitored untill no IR is seen for a certain time.
'W0 is a timeout which either increments(pin0=1, no IR),or is reset to 0
'(pin0=0,IR present).
'The timedout value (1000) will likely need tobe changed to get the responce desired.
Do
Do
infrain
Loop Until infra=1
High 2
w0=0
Do
w0=w0+1 * pin0 '* Multiply or (returns low word of result)
Loop Until w0>30
Low 2
Loop
Thanks Ernie