See the bottom of this code. I want to setup a case statmente to return the HEX code of a button press but I can't get passed this simple thing. All I can seem to return is an int of 16. I'm not sure how to declare the variable
//include librarys
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <IRremote.h>
//defines
const int RECV_PIN = 4;
int MODE = 1;
// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;
// Define LCD pinout
const int en = 2, rw = 1, rs = 0, d4 = 4, d5 = 5, d6 = 6, d7 = 7, bl = 3;
// Define I2C Address - change if reqiuired
const int i2c_addr = 0x27;
LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
lcd.begin(16, 2);
lcd.print("LCD Remote Test");
irrecv.enableIRIn();
}
void loop() {
String k = getCode(); // k now contains 6
//Serial.println(k);
//delay(500);
}
String getCode() {
if (irrecv.decode(&results)){
int test = (results.value, HEX); // this is declared wrong
Serial.println(test); // who to get to print in HEX??
}
switch(MODE){
}
}
.