Joe Wronski stillwatereng.net> writes: > So, it's not that simple, since you also need to set the tris bit to the= =20 > right state. Which could involve another macro statement, like: > #define LED1_TRIS_BIT SomeTrisBitUnion.SomeTrisBit And maybe another=20 > level of macro like #define ENABLE_LED (some code) >=20 Sure, one can make life as complicated, or as simple, as one wishes. =20 For the OP question, the whole program can be as simple as: #include //define XTAL_FREQ, needed for __delay_ms() #define _XTAL_FREQ 20000000 #define LED1 RA0 __CONFIG(FOSC_HS & LVP_OFF & WDTE_OFF ); void main() { TRISA =3D 0; while(1) { LED1 ^=3D 1; __delay_ms(200); }; } or, one can define a whole set of macros and write several functions to tur= n LED on and off. It all depends on one's style and needs of the project (and al= so on one's definition of "simple" :-) ). Best, Sergey Dryga http://beaglerobotics.com --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .