Re:How to upload code in arudino uno for the mentioned code how to solve the err

Hii i am newbie to arduino,i am getting this error at the time of uploading.Kindly guide me gow to solve

``// This program allows an Arduino to power on/off a Duraflame heater using infrared
//
// Usage: hook up an IR led with Annode on pin 13. Then send serial data “POWER”
// to the arduino. It should flash the LED code.
//
// By Rick Osgood with code borrowed from adafruit.com
//

#define IRledPin 13
#define NumIRsignals 96

// This is the code I determined works for my Duraflame heater
int IRsignal = {
// ON, OFF (in 10’s of microseconds)
4, 12,
34, 64,
6, 10,
18, 126,
12, 16,
8, 54,
6, 192,
4, 152,
6, 1432,
12, 576,
4, 66,
8, 86,
10, 72,
10, 116,
22, 590,
8, 16,
20, 18,
14, 18,
28, 200,
10, 32,
26, 14,
8, 12,
42, 18,
10, 14,
4, 88,
10, 10,
14, 52,
24, 8,
16, 12,
16, 6,
18, 10,
34, 30,
14, 8,
16, 16,
16, 26,
10, 28,
16, 28,
10, 54,
42, 24,
38, 14,
58, 32,
12, 34,
18, 14,
18, 78,
10, 82,
10, 6,
12, 10,
36, 38,
12, 46,
12, 206,
10, 22,
36, 0};

void setup(void) {
digitalWrite(IRledPin, LOW); //Make sure LED starts “off”
Serial.begin(9600); //Initialize Serial port
}

void loop() {
char data[6];
int index = 0;

delay(1000); //Serial input seems to need some kind of short delay or the data gets screwed up.

while (Serial.available() > 0) { //Loop if there data on the serial line
if (index < 5) { //Make sure we don’t overflow
data[index] = Serial.read(); //Load a character into the string
index++; //Increment the index to get the next character
}
}

data[5]=’\0’; //Null terminate the string

if (strcmp(data, “POWER”) == 0){ //If the Arduino receives the POWER signal…
Serial.println(“SENDING SIGNAL!”);
for (int i = 0; i < NumIRsignals; i+=2) { //Loop through all of the IR timings
pulseIR(IRsignal_*10); //Flash IR LED at 38khz for the right amount of time_
_ delayMicroseconds(IRsignal[i+1]*10); //Then turn it off for the right amount of time_

  • }*

  • } //Otherwise do nothing!*
    }
    // This function allows us to PWM the IR LED at about 38khz for the sensor
    // Borrowed from Adafruit!
    void pulseIR(long microsecs) {

  • // we’ll count down from the number of microseconds we are told to wait*

  • cli(); // this turns off any background interrupts*

  • while (microsecs > 0) {*

  • // 38 kHz is about 13 microseconds high and 13 microseconds low*

  • digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen*

  • delayMicroseconds(10); // hang out for 10 microseconds, you can also change this to 9 if its not working*

  • digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds*

  • delayMicroseconds(10); // hang out for 10 microseconds, you can also change this to 9 if its not working*

  • // so 26 microseconds altogether*

  • microsecs -= 26;*

  • }*

  • sei(); // this turns them back on*
    }
    Sketch uses 2,786 bytes (8%) of program storage space. Maximum is 32,256 bytes.
    Global variables use 412 bytes (20%) of dynamic memory, leaving 1,636 bytes for local variables. Maximum is 2,048 bytes.
    avrdude: ser_open(): can’t open device “\.\COM34”: The system cannot find the file specified.
    Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

The error you are recieving is caused by the IDE’s inability to ommunicate with the arduino board.

Be sure to select the correct port in the Tools > Port menu.