void setup(void)
{
// Set portB as output.
DDRB = B11111111;
}
// Main
void loop(void)
{
PORTB = B11111111;
delay(1000);
PORTB = B00000000;
delay(1000);
}
Only pin 10, 11, 12 and 13 is working as expected. Pin 8 and 9 is not switching between high and low.
As stated in the original post "PORTB = B11110000" makes pin 13, 12, 11 and 10 go high. That seems to be the opposit of the documentation you found. If changing to "PORTB = B00110000", then only pin 11 and 10 are high.
********** EDIT **********
Hmm... So for the Arduino Mega, port B is: