I had bought an Arduino Starter Kit quite recently.
I tried to upload the code for 7-segment Display but failed. The sketch is getting compiled successfully, but failed to upload it to the board. This is not the problem with only the 7-segment display, but I had also tried to upload the default projects. Nothing seemed to work.
The error message:
Arduino: 1.8.14 (Windows 10), Board: "Arduino Uno" Sketch uses 1182 bytes (3%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes. avrdude: ser_open(): can't open device "\\.\COM4": The semaphore timeout period has expired. Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
I have also tried multiple ways as suggested by others such as restarting the pc, closing and reopening the app, resetting the Arduino board, and many others. Nothing gave a positive output.
My Laptop model:
Huawei MateBook D 15.
Windows 10 Home.