Though the code author's not really done anything wrong, since PINB and PB1 are both defined in the standard header file provided by Atmel, and are standard constants. Arguably he should have used PINB1 instead of PB1 for better clarity. On 3/7/07, Ruben J=F6nsson wrote: > > > > > The thing is PB1 is a constant indicating pin number, and it was > shifting > > the 1 PB1 times to the left and then ANDing it to PINB. > > > > Just a missreading > > > > THANKS!! > > > > Which proves the fact that in order to write maintainable code it is very > important to choose a meaningful name for variables and constants. > > The original author actually did manage half way since he in fact provided > a > way to easily change both the port and pin for a function in one place - > the > header file. > > I would have used macros, though. > > /Ruben > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > Ruben J=F6nsson > AB Liros Electronic > Box 9124, 200 39 Malm=F6, Sweden > TEL INT +46 40142078 > FAX INT +46 40947388 > ruben@pp.sbbs.se > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist