Arduino blinks and then shuts down when plugged in

i had a simple counter ongoing. a basic increment function. the code was running well and functioning properly but suddenly the arduino turned off. i removed the plug and plugged in again but the lights blinked once and the board turned off, or rather didnt turn on at all. now it isnt even registered and not showing on the com3 port, is my board damaged?

this is the code i was using:

#include <LiquidCrystal_I2C.h>
const int buttonPin1 = 2, buttonPin2 = 3;    
int button1_State = 0, button2_State = 0;
int count_value =0;
int prestate =0;
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() 
{
  pinMode(buttonPin1, INPUT);
  pinMode(buttonPin2, INPUT);
  lcd.init();
  lcd.backlight();
  lcd.setCursor(4,0);
  lcd.print("Count:");
  lcd.setCursor(2,1);
  lcd.print(count_value);
}
void loop() 
{
  button1_State = digitalRead(buttonPin1);
  button2_State = digitalRead(buttonPin2);
  if (button1_State == HIGH && prestate == 0) 
  {
    count_value++;  
  lcd.setCursor(0,1);
  lcd.print("> ");
  lcd.print(count_value);
  lcd.print(" ");
    prestate = 1;
  } 
 else if(button1_State == LOW && button2_State == LOW) 
  {
    prestate = 0;
  }
}

this is my setup:

and this is whats happening:

what should i do?

is the green wire plugged into reset (or 3.3V) instead of GND?

image

unplug everything - just keep the USB connection

to 5v, blue is connected to gnd, and i tried that, still no change

if blue is connected to GND you have an issue on the other side and the LCD is wired wrong (damaged now ?)

image

Green should be GND
Blue should be 5V

really unplug everything

yup got it

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.