DFRobot DFR0274 Skrócona instrukcja obsługi - Strona 9
Przeglądaj online lub pobierz pdf Skrócona instrukcja obsługi dla Mikrokontrolery DFRobot DFR0274. DFRobot DFR0274 12 stron. Rgb led strip driver shield
//Convert bits to integer
for(int i = 0 ; i < (FirstLastBit) ; i++)
{
if(bits[i] == 1)
{
result += 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)
{
result += 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);
}
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from