Misc - declare constants const, protect AVR specific code by checking for __AVR__


Make porting easier - Protect AVR specific code by checking for __AVR__, rather than assuming everything that isn't an MSP430 is an AVR.

Reduce memory use by using uin8_t rather than int for pins, and declaring constants const.

Fix some warnings (comparison signed vs. unsigned, functions with incorrect prototypes).

More specific function prototypes.