Showing posts with label compiler. Show all posts
Showing posts with label compiler. Show all posts

Monday, October 25, 2010

error: 'PB4' was not declared in this scope



I saw this error when compiling the Music Shield code for ATMega328. The cause was that ATMega328 uses the following format for port names:

PORT + "letter" + "number" (ie. PORTB4)

instead of

P + "letter" + "number" (ie. PB4)

So all you have to do is to replace every occurrence of P[ABCD][1234] with PORT[ABCD][1234]