Mega 2560 Output Voltage (digital)

Hi guys
(sorry for bad english)
I'm having trouble with the voltage of the digital output.

When i try
pinMode(31,OUTPUT);
digitalWrite(31,HIGH);

And i actually make a measurement at pin 31 i only get 2,3V.
But i need 5V or at least 4V

Does somebody know this problem ?
Thanks !
Greetings Stephn

How are you powering it? You should get a minimum of 4v if power is 5v, according to the datasheet. That means usb power or 7v minimum on Vin. 5 volts on Vin could cause that.

Just checking.

i am powering via usb

may this be the problem ?

thank you !!!!

I am so sorry

I made a mistake in the measurement :drooling_face:

An unloaded output pin will go right to the supply voltage if driven HIGH, and right down to ground if driven
LOW. Only if you load the pin and source/sink current from it will the voltage differ from these limits.