HI Wanderson!
I tried to work with your code, but it doesn't work.
See my comments on the code
Regards, Patrick
digitalWrite(26, HIGH) ;
digitalWrite(10, HIGH) ;//For ATMega 2560: A4= PIN26 value B4= PIN10 value
volatile uint8_t PortVariables[] = { PORTA, PORTB };
uint8_t SelectionVariable = 1; // Setting it to default to PORTBSerial.begin(9600);
// Send the value of bit 4 of PORT B
client.println(bitRead(PORTB,4));//OK: Return 0 or 1 depend if Pin 10 is HIGH or Low
client.println(bitRead(SelectionVariable,4));//Not OK:always return 0SelectionVariable = 0; // Setting it to PORTA
// Send the value of bit 4 of PORT A
client.println(bitRead(PORTA,4));//OK: Return 0 or 1 depend if Pin 10 is HIGH or Low
client.println(bitRead(SelectionVariable,4));//Not OK:always return 0