Pullup on compatible Arduino Mega I've got an Arduino mega compatible board, called Ethermega, from Freetronics (ATmega2560).
Schematic here.
In setup, I've written this code:
Serial.begin(9600);
  pinMode(4, INPUT_PULLUP);
  digitalWrite(4, HIGH); // Optional, I tried with and without
  while (1)
  {
    if (digitalRead(4) == HIGH)
    {
      Serial.write(&quot;Up!\n&quot;);
    }
  }

(Don't worry about the fact I'm not using loop)
When I connect input 4 with 5V, I see &quot;Up!&quot;. Rest of the time, I see nothing.
Considering I have enabled the internal pull-up, I'm expecting it should be up/high by default, and I would have to connect it to GND to get it low...
Another thing that puzzles me is I can find heaps of examples that use a tactile switch and no pullup/pulldown at all...
So what am I missing or doing wrong? Seems like whatever I do, I've got some kind of pulldown enabled...
As @Juraj mentions, pin 4 is the CS pin for the SD card. That pin has a volage divider of 1kΩ + 2.2kΩ on it (a total of 3.2kΩ) to ground. So yes, you do have a pulldown on that pin. 3.2kΩ is about 1/10th of the value of the typical pullup resistor internal to the chip, so pulls the output low enough to be seen as LOW unless you manually override it.
You can't use that pin as an active low input on that board - choose another, or use it as active high.