2

After running the Arduino Program on my Windows machine I got the following error my code and error are as below.

Also the COM port was turned grey i.e. disbaled.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);

void setup()
{
  lcd.begin(16, 2);
}


void loop()
{
  lcd.print("Hello, World!");
  delay(500);
  lcd.clear();
  delay(500);
}

It displayed as shown below

Arduino: 1.8.14 (Windows 10), Board: "Arduino Uno" Sketch uses 1894 bytes (5%) of program storage space. Maximum is 32256 bytes. Global variables use 59 bytes (2%) of dynamic memory, leaving 1989 bytes for local variables. Maximum is 2048 bytes. Serial port not selected.

6
  • 1
    did you connect the Arduino to PC?
    – Juraj
    Jul 10 at 16:08
  • 1
    Yes I connected to PC. Under tools drop down box, Ports icon is greyed out
    – Golden
    Jul 10 at 17:06
  • 1
    Can you check in device manager that when you plug the arduino if any COM ports are available or shown there
    – Maaz Sk
    Jul 10 at 17:09
  • 1
    I have just done that now and it displayed: Device type- Unknown, Location-Port_#0002.Hub_#0002. Thanks
    – Golden
    Jul 10 at 17:27
  • 1
    That means, that Windows has no appropriate driver for it. Do you have a cheap Uno clone? Then you need to install the ch340 driver (which is the USB interface chip on mist cheap Uno/Nano clones). Please try and report if that helps
    – chrisl
    Jul 11 at 8:33
1

I know this problem from Arduino Uno clones. You need a proper driver. Here are a few:

After installing the driver, Windows recognizes the board as a serial port and Arduino IDE will list the serial ports identified by Windows.

Look up the details in device manager. You'll find the IDs in the details of the device named Device instance path. It looks like ...VID_xxxx?PID_yyyy... where xxxx is the vendor ID and yyyy is the product ID. You can also install all drivers, if you don't know which one to choose.

Another (but rare) issue could be that you interrupted the driver setup during Arduino IDE installation. In that case, run the Arduino IDE installation again and make sure you allow the driver installations (for Vendor ID 2341 and 2A03, Product IDs 0043, 0001, 0243).

Any of these suggestions will require administrator permissions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.