varunme
Advanced Member level 3
How can i access port bits using loop like the below ?
Code:
#define _TOTAL_LIGHTS 5
for(i=0; i<_TOTAL_LIGHTS; i++)
{
if (PORTD.[i] == 1)
{
PORTC.[i] = 1;
}
else
{
PORTC.[i] = 0;
}
}