Simulate GND with pin?

Hi!
I have Heart Rate monitor AD8232, so I decided to connect it to Arduino MEGA 2560 to pins 14 - 19 (I don't like using wires). I defined it like

static int Lplus = 15, Lminus = 16, out = 17, vcc = 18, gnd = 19;

I know, I can simulate voltage 3.3V by using analogWrite(vcc, 168) (3.3÷(5÷255)), but how do I do GND on pin 19?

I'm completly new to Arduino. Thanks for your help

sjiamnocna:
...I don't like using wires...

Get over it.

Can set pins with pinMode to output, and digitalWrite a HIGH (almost 5volt) or LOW (almost ground) to it.
But if there are problems, you know where to look first.
There is nothing better than a real VCC and ground.

sjiamnocna:
I know, I can simulate voltage 3.3V by using analogWrite(vcc, 168) (3.3÷(5÷255))

Not true.
A Mega doesn't have analogue outputs, only PWM outputs.
AnalogWrite (misnomer) generates a 5volt PWM signal with varying duty cycle, not a voltage.
Only the 3.3volt pin outputs 3.3volt (150mA absolute max).
Leo..

I can simulate voltage 3.3V by using analogWrite(vcc, 168)

No, you can't. You must use a clean source of 3.3V power and a good ground, especially with sensitive circuitry like this.

You will need to solder either header pins or wires to the sensor board, so as Wawa said, get over your aversion to wires.

sjiamnocna:
I know, I can simulate voltage 3.3V by using analogWrite(vcc, 168) (3.3÷(5÷255)), but how do I do GND on pin 19?

Sorry, it doesn't work like that.

analogWrite produces a digital logic signal, being a PWM rectangular waveform, capable of only small
currents and intolerant of large capacitive loads. This is not a simulation of 3.3V at all.

Your AD8232 board is highly capacitive on its 3.3V supply pin, as its got decoupling capacitors like
any logic circuit.

Basically you need a stable 3.3V power supply to power that AD8232 board, not a logic signal.

Same goes for ground, a logic output cannot be supply ground, its far too high an impedance and
cannot drive large capacitive loads.

BTW such a heart-rate monitor like that must be battery powered for safety.

OK, thx for advices.

So you say, It's not possible and i change only the rectange signal duty period, so the way I can go is e.g. solder the power, GND upside, use a wire and connect the rest to the board pins?

And MarkT says, that ideally I'd get 3V battery and use it as power source?