Hello all. I am working on some code. It uses the wonderful arduino IR receive library.
My specific issue is with the function i have defined at the bottom " getKeyFromIRCode "
the error i get is that it can not be used as a function.
Can somebody please explain to my why this is? I Didnt think that arduino needed prototypes declared (i have other sketched where they are not declared and the aux functions are written after / below the loop() function)
thanks for your time!
// INCLUDES
#include <IRremote.h>
// VARIABLE SETUP
int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;
// set up possible commands / result codes
String bNames[] = {"ON" , "OFF"};
String bCodes[] = {"F740BF" , "F7C03F"};
// FUNCTION PROTOTYPES
int getKeyFromIRCode(results.value);
// FURTHER SETUP
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
Serial.println("we're alive!");
}
void loop() {
int tmp = 0;
if (irrecv.decode(&results)) {
Serial.println("Here Comes The Native Result");
Serial.println(results.value);
Serial.println("There Was The Native Result");
delay(250);
tmp = getKeyFromIRCode(results.value);
irrecv.resume(); // Receive the next value
}
}
// AUX FUNCTIONS
int getKeyFromIRCode(results.value){
Serial.print("was passed");
Serial.println(ircode);
Serial.println("Above is the WasPassed");
return 3; // jsut to get past the compiler
}