The manual says only a particular remote with code 212 works with INFRAIN2, but all 3 of my Sony remotes work when set to control a TV. I don't know what codes they use. Besides, in the US at least, all codes are 4 digits, and none in a long list I have ends in 212.
When an IR signal is received, my IR module (recycled) generates an interrupt, the first line of the routine is INFRAIN2. This command completes by the end of the first burst. The interrupt routine sets a flag for the main program, which re-enables the interrupt after using the infra variable.
I needed to design and make a "Watchdog" circuit to reset the Picaxe (a 18X) because the environment also has non-Sony remotes, which cause a timeout when INFRAIN2 hangs.
Later:
I took the trouble to use a second picaxe, a 14M, to handle the infrared, and had the same results. Finally, I changed the IR module to one made by Sony, and now the device works consistently with a cheap Sony replacement-type remote using the default code for sony.
I don't know why this should make a difference. I thought these modules just demodulated the optical signal in a dumb way. The first one i used was taken from a dud ZIP drive. The output looked OK on an oscilloscope.
When an IR signal is received, my IR module (recycled) generates an interrupt, the first line of the routine is INFRAIN2. This command completes by the end of the first burst. The interrupt routine sets a flag for the main program, which re-enables the interrupt after using the infra variable.
I needed to design and make a "Watchdog" circuit to reset the Picaxe (a 18X) because the environment also has non-Sony remotes, which cause a timeout when INFRAIN2 hangs.
Later:
I took the trouble to use a second picaxe, a 14M, to handle the infrared, and had the same results. Finally, I changed the IR module to one made by Sony, and now the device works consistently with a cheap Sony replacement-type remote using the default code for sony.
I don't know why this should make a difference. I thought these modules just demodulated the optical signal in a dumb way. The first one i used was taken from a dud ZIP drive. The output looked OK on an oscilloscope.
Last edited: