analogWrite 255, but not getting 5vDC

Hello,
This is my code:

void setup() {
// put your setup code here, to run once:
pinMode (9, OUTPUT);

}

void loop() {
// put your main code here, to run repeatedly:
analogWrite(9, 255);
}

When I'm measuring between GND and pin 9, I am getting 4,87vDC.
Why am I not getting 5vDC?

What do you measure on the "5V" pin?

pert:
What do you measure on the "5V" pin?

I tried again today, and now I'm getting 5,15vDC at analogWrite 255.
I'm also getting 5,15vDC on the 5V pin..
What's happening?

How are you powering the board when you measure? If it's with the USB of the PC 4.85V - 5.15V is within specification.

The analog output is always a proportion of the 5v supply , so 255 = supply voltage.

missdrew:
How are you powering the board when you measure? If it's with the USB of the PC 4.85V - 5.15V is within specification.

Yes, it's via the USB of my laptop. Ok.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.