I have to complete a project and long story short, the software specified within the instructions is different to the software that we are using (we are using Wokwi).
The instructions say to use this code:
#include <IRremote.h> //Notice we have included the IRremote library here.
//Variables:
IRrecv irrecv(10); //Set up the IR Reciever, call it irrecv and attach it to the correct pin
decode_results results; //Set up a variable to hold the results
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
irrecv.blink13(true); //Blinks the LED on the Arduino board as it gets data from the remote.
}
void loop() {
// put your main code here, to run repeatedly:
if (irrecv.decode(&results)) {
String tmp = (String)results.value;
if (tmp == "4294967295") //This value tells the Arduino that the previous button is still active.
{
Serial.println("Button still active."); //Report to the serial monitor the last button was still held
down
}
else {
Serial.println(results.value, HEX); //A new button has been pressed with the value shown.
}
irrecv.resume(); // Receive the next value
}
}
//----End Code (copy to here)----```