Can I set digitalWrite other than analog and digital pins?

I want to set the pinMode to a specific pin like in the pin 29 of atmega32. Can I do that?

ATmega32 ?? Do you mean ATmega328 or ATmega32U4 ?

Basically pinMode works with pins that are defined via the pins_arduino.h file for the relevant variant.

Don't understand what you are asking.
But the pin mode can be set as an input r output for any pin on the arduino

Sorry Im not good at explaining. its Atmega328
heres what Im planing.

int reset= 29;                 // pin no. of atmega328 which is the reset

void setup()
{
  pinMode(reset, OUTPUT);      // set reset as output
}


  digitalWrite(reset, low);   // use it when I want to reset the atmega328

I think digitalWrite is for analog and digital only.

jepoy12:
Sorry Im not good at explaining. its Atmega328
heres what Im planing.

int reset= 29;                 // pin no. of atmega328 which is the reset

void setup()
{
 pinMode(reset, OUTPUT);      // set reset as output
}

digitalWrite(reset, low);   // use it when I want to reset the atmega328




I think digitalWrite is for analog and digital only.

You can't do what you are trying to do. The reset pin on a 328P can be set with fuse settings to be either the hardware reset signal for the chip or a general purpose I/O pin, it can't be used for both purposes. If fuses are set to use the reset pin as an I/O you lose the ability to program the chip via bootloader or ISP method so that pin is always used as a hardware reset pin only for any arduino IDE compatible board, and you have no program control over it.

If you want to be able to reset the chip while it's running your sketch, read up on using the watch dog time (WDT), it's easy to do and is the only correct method to perform a chip reset without using external components.

Lefty

Thank you sir.