Hallo,
ich habe mir den Vishay TSOP4836 gekauft und wollte jetzt damit rumspielen. Habe dazu aus dem elektor Buch Arduino von Günther Spanner zuerst die Library runtergeladen von http:\arcfn.com/files/IRremote.zip. Die machte aber beim kompilieren nur Fehler. Dann habe ich von hier: GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols eine andere runtergeladen. Die macht beim kompilieren keine Sorgen.
Ich habe eine HAMA 52451 Mediacenterfernbedienung http://www.amazon.de/Hama-MCE-Remote-Control-PC-Fernbedienung/dp/B000X1EL4W und eine von meinem harman kardon AV Receiver. Mein Problem ist, wenn ich immer die gleiche Taste auf der Hama drücke, sind die angezeigten Codes nicht immer gleich. Unknown wird auch immer angegeben. Bei der hk Fernbedienung steht was von NEC da, der Code pro Taste ist aber auch nicht immer gleich
Kann man dagegen etwas machen? Falsche IR Library?
Bsp. die OK Taste der HAMA, Ausgabe im IDE Terminal
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): -6534 2100 -850 1050 -900 1100 -900 1050 -450 550 -400 600 -900 1050 -400 600 -400 550 -950 1050 -400 600 -400 550 -900 600
76E02EE9
Unknown encoding: 76E02EE9 (32 bits)
Raw (26): 26780 2050 -900 1100 -900 1050 -900 1050 -450 600 -350 600 -900 1100 -350 600 -400 600 -900 1050 -400 600 -400 600 -900 550
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): -6256 2100 -900 1100 -850 1100 -900 1050 -400 600 -400 550 -900 1100 -400 600 -400 600 -850 1100 -400 550 -400 600 -900 550
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): 22316 2000 -950 1050 -900 1050 -950 1050 -400 550 -450 550 -950 1000 -450 550 -450 550 -900 1050 -450 550 -450 550 -900 550
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): -27370 2050 -950 1050 -900 1050 -950 1000 -450 550 -450 550 -950 1000 -450 550 -450 550 -900 1050 -450 550 -450 500 -950 550
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): -31920 2100 -850 1100 -900 1050 -900 1100 -400 550 -450 550 -900 1100 -400 550 -400 600 -900 1100 -350 600 -400 650 -850 600
6757E6B4
Unknown encoding: 6757E6B4 (32 bits)
Raw (24): 17536 2100 -850 1050 -950 1050 -900 1100 -850 1100 -900 1100 -350 600 -400 600 -900 600 -350 1100 -400 600 -850 600
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): 13386 2050 -900 1100 -900 1050 -900 1050 -400 600 -400 600 -900 1050 -400 600 -400 550 -950 1050 -400 600 -400 550 -900 600
E1AF4809
Unknown encoding: E1AF4809 (32 bits)
Raw (26): -964 2050 -900 1100 -900 1050 -900 1100 -400 550 -450 550 -900 1050 -450 600 -350 600 -900 1050 -400 600 -400 600 -900 550
3AB8B376
Unknown encoding: 3AB8B376 (32 bits)
Raw (26): 10836 2050 -900 1050 -900 1050 -950 1050 -400 600 -400 600 -900 1100 -350 600 -400 550 -900 1100 -400 550 -450 550 -900 600
Programmcode
/*
* IRremote: IRrecvDump - dump details of IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
*/
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//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 == 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 {
Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
}
Serial.print(" ");
}
Serial.println("");
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
dump(&results);
irrecv.resume(); // Receive the next value
}
}