help with hex

I am trying to us iremote library for menu buttons on my project when I push a button it gets put into results and I look at that to see if it is the button I pressed the problem is it keeps doing that button over and over again I need to make results go back to 0 or something other then the last button I pressed here is my code let me know if you have any ideas

results seems to be a hex data type and I have no idea how to deal with it

if (irrecv.decode(&results)) { irup = false; if (results.value == 0xB54A02FD) irup = true; irdown = false; if (results.value == 0xB54A827D) irdown = true; irmenu = false; if (results.value == 0xB54A9867) irmenu = true; irrecv.resume(); // Receive the next value

I tried adding the following at the bottom of this to reset results but I cant get it to reset results = 0; // does not compile String results = String(0x0); does nothing results.value = 0x00000000; does nothing

this one compiles

#include <IRremote.h>

int RECV_PIN = A1;
int OUTPUT_PIN = 13;
boolean up,down,menu;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
pinMode(OUTPUT_PIN, OUTPUT);
pinMode(13, OUTPUT);
irrecv.enableIRIn(); // Start the receiver
Serial.begin(9600);
}

int on = 0;
unsigned long last = millis();

void loop() {
if (irrecv.decode(&results)) {
up = false;
if (results.value == 0xB54A02FD) up = true;
down = false;
if (results.value == 0xB54A827D) down = true;
menu = false;
if (results.value == 0xB54A9867) menu = true;
irrecv.resume(); // Receive the next value

if (irrecv.decode(&results)) {Serial.print(“0x”),
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}

if(up || menu) digitalWrite(OUTPUT_PIN, HIGH);
if(down) digitalWrite(OUTPUT_PIN, LOW);

}}

I added curley braces :"

void loop() { if (irrecv.decode(&results)) { up = false; if (results.value == 0xB54A02FD) {up = true; down = false;} if (results.value == 0xB54A827D) {down = true; menu = false;} if (results.value == 0xB54A9867){ menu = true; irrecv.resume(); }// Receive the next value

Maybe you needed curly braces to separate blocks of logic. Maybe not.

didnt work

the buttons are working the problem is they repeat every scan till I push a different button on the remote

So after you get a good results value & do the action, set set results value to something that is not valid, then no further actio will occur until another good results value occurs.

changing the value of "results" to something that is not valid is the first thing I tried but I dont know how to change it

Try this

void loop() {
  if (irrecv.decode(&results)) 
{
    up = false;
}
    if (results.value == 0xB54A02FD) 
{
up = true; 
    down = false;
results.value = 0;
}
    if (results.value == 0xB54A827D)
{ down = true;
    menu = false;
results.value = 0;
}
   if (results.value == 0xB54A9867)
{ menu = true;
   irrecv.resume(); // Receive the next value
results.value = 0;
} 
  if (irrecv.decode(&results)) 
{
Serial.print("0x"),
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
results.value = 0;
}
  
  if(up || menu) digitalWrite(OUTPUT_PIN, HIGH);
  if(down) digitalWrite(OUTPUT_PIN, LOW);

}}

no response from the remote now

Well, I must admit I don't really know what you're doing then.

i figured it out changed it to this notice I am changing to false out side of the if statement oops my fault irup = false; irdown = false; irmenu = false;

if (irrecv.decode(&results)) { if (results.value == 0xB54A02FD) irup = true; if (results.value == 0xB54A827D) irdown = true; if (results.value == 0xB54A9867) irmenu = true; irrecv.resume(); // Receive the next value