
//Convert bits to integer
for(int i = 0 ; i < (FirstLastBit) ; i++)
{
if(bits[i] == 1)
{
= seed;
}
seed *= 2;
}
if (output_verify)
{
Serial.print("Remote ");
Serial.print(result);
Serial.println(" verification code");
}
if (remote_verify != result) {delay (60); get_ir_key();} //verify first
group of bits. delay for data stream to end, then try again.
}
/*
convert an array of binary values to a single base-10 integer
*/
int bits_to_int(int bits[])
{
int result = 0;
int seed = 1;
//Convert bits to integer
for(int i = (IR_BIT_LENGTH-FirstLastBit) ; i < IR_BIT_LENGTH ; i++)
{
if(bits[i] == 1)
{
= seed;
}
seed *= 2;
}
return result;
}
/*
respond to specific remote-control keys with different behaviors
*/
void do_response(int key)
{
if (output_key)
{
Serial.print("Key ");
Serial.println(key);
}
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from