I want to set the brightness of a LED of my arduino. I know how to do this with the analogwrite() function of the arduino. Now I want to do this without the analogwrite() function and use PORT manipulations.
I can write to a port like this: PORTD = 0b00001000. This sets an output to PIN 3. But with this I cant set the brightness. Is there some trick to set the brightness for this?