IRemote Not Working!

When I try to compile this code it always comes up with this error message stating:Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Uno"

/var/folders/xw/cfvwqcdx1kd7xqgc2wjn518m0000gp/T//cce5eVWi.ltrans0.ltrans.o: In function main': Multiple libraries were found for "IRremote.h" Used: /Users/johanntorres/Documents/Arduino/libraries/IRremote Not used: /Users/johanntorres/Documents/Arduino/libraries/Arduino-IRremote-2.1.0 /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/main.cpp:43: undefined reference to setup'
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/main.cpp:46: undefined reference to `loop'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/main.cpp

Is this like really common for MacOS or am I doing something wrong?

Would thank anyone who responds... :slight_smile:

Every sketch must have a setup() and loop() function, even if they are empty. See File > Examples > 01.Basics > BareMinimum and:

Now its stating an error 'Could not open device COM1'

Select the COM port of your Arduino from the Tools > Port menu. If the menu is disabled or the correct port is not shown you may be using a charge-only USB cable or a defective cable or you may need to install the driver.

It sounds like you are new to Arduino. I recommend you to start with some of the example sketches under File > Examples > 01.Basics accompanied by the tutorial pages for those examples:

so you can get an understanding of the fundamental concepts.

And finally where does Arduino print these results out?

What results?

The results for each indvidual remote press and I've tried the serial monitor too...

Please post your full sketch. If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's ok to add it as an attachment.

When your code requires a library that's not included with the Arduino IDE please always post a link(using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

Here

#include <IRremote.h>

int RECV_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
}

You forgot the code tags.

That will print to the Serial Monitor. You need to make sure the baud rate menu at the bottom corner of the Serial Monitor is set to 9600 to match the value you set in Serial.being().

A good troubleshooting technique is to add some Serial.println() statements as a sanity check:

#include <IRremote.h>

int RECV_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  Serial.println("Program starting");
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
  delay(100);
  Serial.println("loop");
}

If you can see those prints then you know the serial communication is working fine.

I see the loop prints, my circuit is all wired up, my sketch exact, no typos but still no response to a press.

What is the part number of your IR decoder?
If everything is right on the Arduino end, one must suspect the remote.
Check the remote. Is it transmitting? You can tell if you point the remote at your cell phone camera and push a button. You should see a flash. There are many remote protocols. Not all are recognized by the IRRemote library, Try a different remote.