Arduino Nano- Can't program

Hi,

I tried uploading below shown code to arduino nano (my program contains 2 big classes and 2 small classes).

void setup() 
{
  // put your setup code here, to run once:

  Serial.begin(9600);
  pinMode(KSEB_pin,INPUT);  //kseb input

}

void loop() 
{

  //created class objects


  wdt_disable();
  //wdt_enable(WDTO_2S);
  //wdt_reset();


  while(1)
  {
       //my program

       wdt_reset();
   }

}

After i tried to upload this code, I can't program my arduino nano. What can I do?

Error messages

 avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x79
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x79

Hi,
Problem solved. I tried resetting just before code uploading.

Its working fine. While uploading this problem there was an infinite loop in my program. So it keeps resetting. I might have tried to upload program again in between. So something happened. But however now its working fine.

:slight_smile: