error 'PORTB' undeclared

AlbertHall:
I'm still bemused that the 'blink' code doesn't need this but never mind, I can get on with the rest of the code.

The blink code does probably not access PORTB via a #define. Your code would have worked if you had accessed PORTB directly :slight_smile: