analogWrite(13, -255); question

how come i can’t pulse negative with this function hown the hell do you create an ac wave

Get a Digital to Analog converter that will work with a bipolar power supply (+, - output). There is no way to generate true AC without external components.

peeniewallie:
how come i can't pulse negative with this function hown the hell do you create an ac wave

Where did you imagine that -5V would come from ?

Come to that, the PWM outputs only output 0V and 5V and pin 13 is not a PWM pin anyway

peeniewallie:
how come i can't pulse negative with this function hown the hell do you create an ac wave

Relativity.
With 5V PWM, 0 is -2.5V and 255 is +2.5V

relative to 2.5V mid-rail that is.

Yours,
TonyWilk

TonyWilk:
Relativity.
With 5V PWM, 0 is -2.5V and 255 is +2.5V

relative to 2.5V mid-rail that is.

Yours,
TonyWilk

tnx

(deleted)