Have an ongoing project and would like to use the numbers on the remote.
Not a problem with single entries -- But -- how do I go about the code for entering anything above "9" such as 10, 22, etc ?
any and all comments welcomed.
Have an ongoing project and would like to use the numbers on the remote.
Not a problem with single entries -- But -- how do I go about the code for entering anything above "9" such as 10, 22, etc ?
any and all comments welcomed.
Most TV remotes have an Enter button and will accumulate digits until:
Most receivers will also act on digits received with no Enter received.
So receive a digit, if no Enter then wait some time amount and act on it.
If another is received, restart the time limit, then act on two.
Same for three. If a 4th is received, roll the digits left and keep the last 3 received. Or 4.
My TV for example will accept 68-4, and then change channels after a time or after Enter.
(I'd have to look to see what happens if I enter xxx-x, or xx-xx as 69-4 and 58-6 are the highest in our area).
If Enter is received, then act on what is received, such as 2-2.
(Over the air TV, lots of stations with subchannels now).
First ... thanks for answering my question.
But .... neither of the 2 remotes that I am using have an "Enter" key or button. I have added the jpgs of the 2 remotes.
I think the TV remote would work as it does have the "enter" button and if the enter is not pressed it maintains the channel.
I really would like to use the numerical remote as this would allow more possible functions than 44
Again, thanks for answering.


Here is the mp3 IR remote and code.
Since it is inside the main loop which runs continuously, I think this is where the problem lies in obtaining the second number key entry.
Any and all comments welcomed.
/* YourDuino.com Example Software Sketch; Car MP3 IR codes
IR Remote Kit Test
Uses YourDuino.com IR Infrared Remote Control Kit 2
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=153
based on code by Ken Shirriff - http://arcfn.com
Get Library at: https://github.com/shirriff/Arduino-IRremote
Unzip folder into Libraries. RENAME folder IRremote
terry@yourduino.com */
#include "IRremote.h"
int receiver = 11;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
Serial.begin(9600);
Serial.println("IR Receiver Raw Data + Button Decode Test");
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
translateIR();
irrecv.resume();
}
}
void translateIR()
{
switch(results.value)
{
case 0xFFA25D:
Serial.println(" CH- ");
break;
case 0xFF629D:
Serial.println(" CH ");
break;
case 0xFFE21D:
Serial.println(" CH+ ");
break;
case 0xFF22DD:
Serial.println(" PREV ");
break;
case 0xFF02FD:
Serial.println(" NEXT ");
break;
case 0xFFC23D:
Serial.println(" PLAY/PAUSE ");
break;
case 0xFFE01F:
Serial.println(" VOL- ");
break;
case 0xFFA857:
Serial.println(" VOL+ ");
break;
case 0xFF906F:
Serial.println(" EQ ");
break;
case 0xFF6897:
Serial.println(" 0 ");
break;
case 0xFF9867:
Serial.println(" 100+ ");
break;
case 0xFFB04F:
Serial.println(" 200+ ");
break;
case 0xFF30CF:
Serial.println(" 1 ");
break;
case 0xFF18E7:
Serial.println(" 2 ");
break;
case 0xFF7A85:
Serial.println(" 3 ");
break;
case 0xFF10EF:
Serial.println(" 4 ");
break;
case 0xFF38C7:
Serial.println(" 5 ");
break;
case 0xFF5AA5:
Serial.println(" 6 ");
break;
case 0xFF42BD:
Serial.println(" 7 ");
break;
case 0xFF4AB5:
Serial.println(" 8 ");
break;
case 0xFF52AD:
Serial.println(" 9 ");
break;
default:
Serial.println(" other button ");
}
delay(500);
}
techIV:
But .... neither of the 2 remotes that I am using have an "Enter" key or button.
Then use a combination of Method 1 and Method 2.
Thank you for responding to my question.
If I understand correctly, I need to create a wait-state for multiple inputs -- that will be new for me.
I think the path would be something like ... read value of switch case and store that, check to see if any other number entry has been pressed within specified time window, act on new value if 2 entries.
That will be a challenge for me, not having done this before.
In the meantime I will complete the single remote with the 44 buttons and have some fun with creating functions for those.
For one-digit or two-digit inputs:
If there is a digit waiting and it has been two seconds since the time recorded when the digit arrived, use the single digit.
If there is a digit waiting and a non-digit arrives, process the single digit and then the non-digit.
If a digit arrives and a digit is already waiting, use both immediately. If no digit is waiting, mark this digit as waiting and note the time.