Example: Reading and writing bytes (review)


void main (void)
{
unsigned char Port1_value;
/* Must set up P1 for reading */


P1 = 0xFF;
while(1)
{
/* Read the value of P1 */
Port1_value = P1;
/* Copy the value to P2 */
P2 = Port1_value;
}
}