I am currently making my first steps on avr, and I have seen in a tutorial someone shifting bits using a number and not using the macro of a pin.
This is the example I saw:
int main() {
DDRB |= (1<<0);
while(1) {
//Set to HIGH
PORTB |= (1<<0);
_delay_ms(500);
//Set to LOW
PORTB &= ~(1<<0);
_delay_ms(500);
}
return 0;
}
while all other examples I saw are as follow:
int main() {
DDRB |= (1<<PB0);
while(1) {
PORTB |= (1<<PB0);
_delay_ms(500);
PORTB &= ~(1<<PB0);
_delay_ms(500);
}
return 0;
}
So my question is, does writing PBX(or for that matter PCX or PDX) the same as writing X?
Or in other words are PBX, PCX, PDX defined as X?
Thanks for help!