Arduino COM ERROR :( ...HELP SOS~~

ok guys i’ve settled this programming code problem…

but there is one more problem arise when i tried to upload to my arduino UNO…

avrdude: ser_open(): can’t open device “\.\COM5”: Access is denied.

i just combined the temperature reading code with the blynk example code. The blynk is showing online status but i just cant get the serial monitor to open…tried all the usb ports in my laptop still don’t help…

SOS…Please help and guide me

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial (2,3); //RX , TX
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>

char auth [] = "39a89ba968c74d20820a0e7431080527";
    //Declare the variables  
    int temp;  
    int temppin = 5;  
    int led1 = 7;  
    int led2 = 6; 

void setup ()
{
  DebugSerial.begin(9600);
  Serial.begin(9600);
  Blynk.begin(auth, Serial);
 


        pinMode(led1, OUTPUT);  
        pinMode(led2, OUTPUT);  
        Serial.begin(9600); //BaudRate  
      
    void loop()  
    
        temp = analogRead(temppin);  
        float t = (temp / 1024.0) * 5000;  
        float celsius = t / 10;  
        float farh = (celsius * 9) / 5 + 32;  
        //Celsius Temperature  
        Serial.print("Temperature =");  
        Serial.print(celsius);  
        Serial.print("°C");  
        Serial.println();  
        delay(1000);  
        if (celsius > 30)  
        {  
            digitalWrite(led2, HIGH);
            digitalWrite(led1, LOW);  
        }  
        else  
        {  
            digitalWrite(led2, LOW);
            digitalWrite(led1, HIGH);  
        }  
        if (celsius < 30)  
        {  
            digitalWrite(led1, HIGH);
            digitalWrite(led2, LOW);  
        }  
        else  
        {  
            digitalWrite(led2, HIGH);
            digitalWrite(led1, LOW);  
        }  
         
        {
          Blynk.run();
        }
        
}

i am using Blynk to monitor my LM35 sensor on Arduino Uno through USB… am i doing it right?

Your code looks very poorly indented and this is your issue. Lean to always keep code correctly indented and many bugs will be evident

==> Press ctrl-T to indent your code and you’ll see something clearly misaligned for your functions... then look for the missing { or } (or both)

You also have two Serial.begin(9600);that’s one too many

ALL THE ABOVE - PLUS A big hint... Take a look at how your loop() function is formed.

Let us remember -- an Arduino Sketch always begins with the following two functions:

void setup()
{                                //opening brace

}                               //closing brace

void loop()
{                               //opening brace

}                               //closing brrace

Check that the formats of the setup() and loop functions of your sketch agree with the above.

There could be many more braces {}, parentheses (), and brackets [] in a program; but, they must be balanced. Balanced refers to the fact that when there is an opening brace/parenthesis/bracket, there must be a corresponding closing brace/parenthesis/bracket.

ok guys i've settled this programming code problem..

but there is one more problem arise when i tried to upload to my arduino UNO..

avrdude: ser_open(): can't open device "\.\COM5": Access is denied.

i just combined the temperature reading code with the blynk example code. The blynk is showing online status but i just cant get the serial monitor to open..tried all the usb ports in my laptop still don't help...

SOS....Please help and guide me

Has it ever work? Did you install necessary drivers ? Check usb cable Reboot your PC Ensure usb Port is correctly selected Ensure correct Arduino board is selected Try again

J-M-L: Has it ever work? Did you install necessary drivers ? Check usb cable Reboot your PC Ensure usb Port is correctly selected Ensure correct Arduino board is selected Try again

1.) yup.. before i did anything for iot part, i've tested it on my circuit..the code works perfectly 2.) installed Blynk libraries and unzipped correctly as i am able to control the LED in arduino thru Blynk app but just that codes cant be uploaded to the arduino uno right now. 3.) this is something suspecious too but i am able to upload to the board correctly before iot part. 4.) done it...same case 5.) just COM port 5 are able to be selected.. 6.) arduino uno ..yes 7.) ok :(

change USB port

Sometimes, the following tricks work:

1. Plug-out and Plug-in the USB Cable. Check that Arduino/Genuino Uno on COM4/COMX message has appered at the bottom of the IDE Window.

2. IDE -->Tools and click. Check the following messages on the drop-down menu: (a) Board: "Arduino/Genuino Uno". If not, select from the Board Menu (b) Port: "COM4 (Arduino/Genuio Uno)"

3. Just Verify/Compile the sketch. Check that the sketch has been compiled.

4. Upload the sketch. If uploading problem (COM4/COMX is not found), goto the next step.

5. Device Manager ---> Ports (COM & LPT) ---> Arduino Uno (COM4) ---> Update Driver Software... (click) ---> Browse my computer for driver software (select) ---> Let me pick from a list of device drivers on my computer (select) ---> Arduino Uno (select) ---> next

6. If the Arduino Uno appears as other devices with (!) sign, then follow Step-5 (starting from Update Driver Software...) on that device.

Re-booting the PC also helps. Closing all the IDEs and launching only one IDE also helps.

J-M-L: change USB port

hmm..i not sure why but when i pluck out all the wires from the board, it seems to be able to upload into it...now my blynk still cant show output of LM35 sensor data.

anyway i also tried pluck out VCC of LM35 , it seems to be able to uploaded into arduino board

i was able to upload my code into arduino board and then i open the command prompt for blynk connection....now circuit is ok just that i cant view serial plotter where before this i can see "Temperature now is __ degree celsius"...it showing "Error opening serial port 'COM5'. (Port busy)" ..