Hi all,
As the title states...."How do we use an IR remote control & detect multiple button-presses?"
I'm building a small IR-picaxe interface to add into a legacy piece of equipment, but the equipment needs to detect a single button-press up to a 3 digit button-press to enable different modes etc.
So, pressing "1" will perform a certain function and pressing "12" will perform something else, and pressing "123" will perform something else entirely.
The picaxe "function" might just toggle a few bits on a picaxe to control the external equipment, or somethimes send a full byte value to a picaxe port etc.
My initial challenge is how i go about detecting each IR-remote button-press and then store/process it within the picaxe?
My first thoughts are to maybe create 4 variables, such as b0, b1, b2, b3.
I would use b0 to detect the incoming IR button code, then i would check to see which of the variables b1 or b2, or b3 are empty, and then copy b0's data into that empty (available) b1, or b2, or b3.
Assuming i press "12" or "123", the data currently in b0 would need to be checked which of the b1,b2,b3 bytes are empty and can accept this byte.
Of course, after the 1, 2 or 3 button-presses have been detected and processed, the picaxe would then clear all 4 variables in readiness for the next IR codes at a later time.
Am i on the right track so far?, or is there a much simpler way to handle multiple button-presses from an IR remote control?
Thanks in advance, if anyone can share there previous IR multi-byte experience with me.
As the title states...."How do we use an IR remote control & detect multiple button-presses?"
I'm building a small IR-picaxe interface to add into a legacy piece of equipment, but the equipment needs to detect a single button-press up to a 3 digit button-press to enable different modes etc.
So, pressing "1" will perform a certain function and pressing "12" will perform something else, and pressing "123" will perform something else entirely.
The picaxe "function" might just toggle a few bits on a picaxe to control the external equipment, or somethimes send a full byte value to a picaxe port etc.
My initial challenge is how i go about detecting each IR-remote button-press and then store/process it within the picaxe?
My first thoughts are to maybe create 4 variables, such as b0, b1, b2, b3.
I would use b0 to detect the incoming IR button code, then i would check to see which of the variables b1 or b2, or b3 are empty, and then copy b0's data into that empty (available) b1, or b2, or b3.
Assuming i press "12" or "123", the data currently in b0 would need to be checked which of the b1,b2,b3 bytes are empty and can accept this byte.
Of course, after the 1, 2 or 3 button-presses have been detected and processed, the picaxe would then clear all 4 variables in readiness for the next IR codes at a later time.
Am i on the right track so far?, or is there a much simpler way to handle multiple button-presses from an IR remote control?
Thanks in advance, if anyone can share there previous IR multi-byte experience with me.