Page 234 - 최강 아두이노 스마트 자동차 로봇 키트
P. 234

//void dump(void *v) {
                 //  decode_results *results = (decode_results *)v

                 void dump(decode_results *results) {
                     int count = results->rawlen;
                     if (results->decode_type == UNKNOWN) {
                         Serial.print("Unknown encoding: ");
                     }
                     else if (results->decode_type == NEC) {
                         Serial.print("Decoded NEC: ");
                     }
                     else if (results->decode_type == SONY) {
                         Serial.print("Decoded SONY: ");
                     }
                     else if (results->decode_type == RC5) {
                         Serial.print("Decoded RC5: ");
                     }
                     else if (results->decode_type == RC6) {
                         Serial.print("Decoded RC6: ");
                     }
                     else if (results->decode_type == PANASONIC) {
                         Serial.print("Decoded PANASONIC - Address: ");
                         Serial.print(results->panasonicAddress, HEX);
                         Serial.print(" Value: ");
                     }
                     else if (results->decode_type == LG) {
                         Serial.print("Decoded LG: ");
                     }
                     else if (results->decode_type == JVC) {
                         Serial.print("Decoded JVC: ");
                     }
                     Serial.print(results->value, HEX);
                     Serial.print(" (");
                     Serial.print(results->bits, DEC);
                     Serial.println(" bits)");
                     Serial.print("Raw (");
                     Serial.print(count, DEC);
                     Serial.print("): ");

                     for (int i = 0; i < count; i++) {
                         if ((i % 2) == 1) {
                             Serial.print(results->rawbuf[i] * USECPERTICK,
                 DEC);
                         }
                         else {





                                                   233
   229   230   231   232   233   234   235   236   237   238   239