Display color in arduino mega 2560 + ethernet shield (TROUBLE)

I’m using the pin 50 and 52 to change the color of a display 16x2, my program works fine if i don’t use the ethernet shield. If I used it just the Red color works well.
Wich pins control the color in mega 2560?

Servicio.h (817 Bytes)

testcolor.ino (3.29 KB)

The Ethernet shield is controlled via the SPI bus. On the Mega, the SPI bus is connected to pins 50-52. So you can't use those pins for anything other than SPI communication when you're using the Ethernet shield. Use other pins.

You also need to be careful about how you use pin 53 when the SPI bus is being used.

More information:
https://www.arduino.cc/en/Reference/SPI