using the IRremote libray i m having a few problems in storing the raw data inside an array to use after
this is the code from which i receive correct raw data but i tryed a few strategy to store them but i m not able
i left an empy function Store(); if someone have any idea how to do it
later i ll add a button matrix to store a few raw values like power, channel + -, volume + - ecc ecc
#include <IRremote.h>
//objects
IRrecv irrecv(11);
decode_results results;
IRsend irsend; //pin 3
int buttonPin = 2;
boolean state;
int khz = 38; //how to know the correct value? google?
//Raw data to store
//.....
void setup () {
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(buttonPin, INPUT_PULLUP);
delay(1000);
Serial.println("READYYYY");
}
void loop () {
if (irrecv.decode(&results)) {
Info(&results);
Code(&results);
irrecv.resume();
Serial.println("");
}
Store();
Send();
}
void Info (decode_results *results) {
Serial.print("Code : ");
ircode(results);
Serial.print(" (");
Serial.print(results->bits, DEC);
Serial.println(" bits)");
}
void ircode (decode_results *results) {
Serial.print(results->value, BIN);
}
void Code (decode_results *results) {
Serial.print("rawData[");
Serial.print(results->rawlen - 1, DEC);
Serial.print("] = {");
for (int i = 1; i < results->rawlen; i++) {
Serial.print(results->rawbuf[i] * USECPERTICK, DEC);
if ( i < results->rawlen - 1 ) Serial.print(",");
if (!(i & 1)) Serial.print(" "); // ',' not needed on last one
}
Serial.println("};");
}
void Store() {
}
void Send() {
state = !digitalRead(buttonPin);
if (state) {
// irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);
}
}