Simulate push button with arduino

Yes, correct.
But what about the code for pressing/releasing each one?
johnwasser told me that for the one that is 0v when pressed (actually mode button, that i have connected throough 1N4148) i had to do this:
digitalWrite(powerButton, LOW);
pinMode(powerButton, OUTPUT); // Pull the signal low to activate the power button
delay(500); // Wait half a second
pinMode(powerButton, INPUT); // Release the power button.

never setting it to HIGH...
but what about the one that i driven by the PNP ?