Good day! I have been working with Atmel Studio lately and am a bit confused about notation. Thus far, when I reference a pin, I usually just use the PORTxn notation (example: PORD0). However, I constantly come across code samples on the internet that employ an abbreviated form Pxn (PD0). I tried using this form because it seems very convenient but anytime I do it Atmel underlines it in red and throws an error, saying that it does not exist even though I have included the avr/io.h header in my file. Any ideas what might be going wrong? Here is my sample code. You can see the red underline for PD2. Thanks for the help!
avr/portpins.h which has the abbreviated forms. Maybe it has something to do with that first include you have? Try removing the
#include <io.h> and the
#define PD5 = 5 lines, and also check if you have the correct microcontroller configured in your project settings.