I searched all over the web for this error but havnt found it. here is the code and error message.
Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"
Build options changed, rebuilding all
Multiple libraries were found for "IRremote.h"
Used: C:\Users\Owner\Documents\Arduino\libraries\IRremote
Not used: C:\Program Files (x86)\Arduino\libraries\RobotIRremote
Sketch uses 10,188 bytes (31%) of program storage space. Maximum is 32,256 bytes.
Global variables use 469 bytes (22%) of dynamic memory, leaving 1,579 bytes for local variables. Maximum is 2,048 bytes.
avrdude: ser_open(): can't open device "\.\COM3": Access is denied.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
and here is the code...
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
irrecv.enableIRIn(); // Start the receiver
Serial.begin(9600);
}
// Compare two tick values, returning 0 if newval is shorter,
// 1 if newval is equal, and 2 if newval is longer
// Use a tolerance of 20%
int compare(unsigned int oldval, unsigned int newval) {
if (newval < oldval * .8) {
return 0;
}
else if (oldval < newval * .8) {
return 2;
}
else {
return 1;
}
}
// Use FNV hash algorithm: FNV Hash
#define FNV_PRIME_32 16777619
#define FNV_BASIS_32 2166136261
/* Converts the raw code values into a 32-bit hash code.
- Hopefully this code is unique for each button.
/
unsigned long decodeHash(decode_results results) {
unsigned long hash = FNV_BASIS_32;
for (int i = 1; i+2 < results->rawlen; i++) {
int value = compare(results->rawbuf, results->rawbuf[i+2]); - // Add value into the hash*
hash = (hash * FNV_PRIME_32) ^ value; - }*
- return hash;*
}
void loop() { - if (irrecv.decode(&results)) {*
- Serial.print("'real' decode: ");*
- Serial.print(results.value, HEX);*
- Serial.print(", hash decode: ");*
- Serial.println(decodeHash(&results), HEX); // Do something interesting with this value*
- irrecv.resume(); // Resume decoding (necessary!)*
- }*
}
#define LEDPIN 13
void blink() { - digitalWrite(LEDPIN, HIGH);*
- delay(200);*
- digitalWrite(LEDPIN, LOW);*
- delay(200);*
*} *
// Blink the LED the number of times indicated by the Philips remote control
// Replace loop() with this for the blinking LED example.
void blink_example_loop() { - if (irrecv.decode(&results)) {*
- unsigned long hash = decodeHash(&results);*
- switch (hash) {*
- case 0x322ddc47: // 0 (10)*
- blink(); // fallthrough*
- case 0xdb78c103: // 9*
- blink();*
- case 0xab57dd3b: // 8*
- blink();*
- case 0x715cc13f: // 7*
- blink();*
- case 0xdc685a5f: // 6*
- blink();*
- case 0x85b33f1b: // 5*
- blink();*
- case 0x4ff51b3f: // 4*
- blink();*
- case 0x15f9ff43: // 3*
- blink();*
- case 0x2e81ea9b: // 2*
- blink();*
- case 0x260a8662: // 1*
- blink();*
- break;*
- default:*
- Serial.print("Unknown ");*
- Serial.println(hash, HEX); *
- }*
- irrecv.resume(); // Resume decoding (necessary!)*
- }*
}
please help I used to know how to fix these things but has been 5 years so I'm a little rusty.