Hi,
OS: Windows 10
Board: Arduino UNO
So i am making prject using arduino uno and i had installed arduino IDE onto my windows, for the first 2 weeks it was working fine until for some reason it now no longer detects the port
I tried looking in my device manager for "port" or "other devices" however there is no port tab and arduino doesn't appear on other devices
I have tried to go the arduino IDE menu and click on tool -> ports however it stays greyed out
I have tried using a different cable than the normal USB to Arduino with a printer cable but it has not changed the problem
I can show you the circuit diagram i am using if that helps
And here is the code i wish to upload to the arduino if it helps
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DS1302.h>
// Set the LCD address to 0x3F for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x3F, 16, 2);
// Define your variables
int Hour;
int Min;
int Sec;
int period;
int in1 = 8;
int in2 = 9;
int activate = 0;
// Create an instance of the DS1302 class
DS1302 rtc(2, 3, 4); // Adjust the pin numbers as needed
void setup() {
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
// Set the clock to run-mode, and disable the write protection
rtc.halt(false);
rtc.writeProtect(false);
// Setup LCD to 16x2 characters
lcd.begin(16, 2); // Corrected to include number of columns and rows
Serial.begin(9600);
// Get the current time from the RTC
Time t = rtc.time(); // Retrieve the current time
// Print the current time to the Serial Monitor
Serial.print("Current Time: ");
Serial.print(t.hr);
Serial.print(":");
Serial.print(t.min);
Serial.print(":");
Serial.println(t.sec);
}
void loop() {
// Get the current time from the RTC
Time t = rtc.time(); // Retrieve the current time again in loop
Hour = t.hr;
Min = t.min;
Sec = t.sec;
// Display time on the right corner upper line
lcd.setCursor(0, 0);
lcd.print("Time: ");
lcd.setCursor(6, 0);
lcd.print(Hour);
lcd.print(":");
lcd.print(Min);
lcd.print(":");
lcd.print(Sec);
// Display Period Number
lcd.setCursor(0, 1);
lcd.print("Period No: ");
lcd.setCursor(11, 1);
lcd.print(period);
// Period timing, when bell will ring
if ((Hour == 7 && Min == 0 && Sec == 5) ||
(Hour == 7 && Min == 30 && Sec == 5) ||
(Hour == 8 && Min == 0 && Sec == 5) ||
(Hour == 8 && Min == 30 && Sec == 5) ||
(Hour == 9 && Min == 30 && Sec == 5) ||
(Hour == 10 && Min == 0 && Sec == 5) ||
(Hour == 10 && Min == 30 && Sec == 5) ||
(Hour == 11 && Min == 0 && Sec == 5)) {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
Serial.println("motor is running");
if (activate == 0) {
period = period + 1;
activate = 1;
}
} else if (Hour == 9 && Min == 0 && Sec == 7) { // Recess break time
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
lcd.setCursor(11, 1);
lcd.print("Break");
delay(500);
lcd.clear();
} else if (Hour == 11 && Min == 30 && Sec == 7) { // School time over
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
lcd.setCursor(11, 1);
lcd.print("Over");
period = 0;
delay(500);
lcd.clear();
} else { // Stop motor
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
activate = 0;
}
delay(500);
}
I am so confused and would appreciate any help if possible
Sorry for any mistakes







