On 6/17/07, larry barello <yahoo@barello.net> wrote: > > PORTA &= _BV(PA1); > If (random value) > PORTA |= _BV(PA1); > > You can define PORTA as a bit-field and have the compiler do the work for > you. It seems to me that if ( random value) is going to be 1 except when random value is 0. I expect that what you really want is something like combining a bit field and using PORTA.bit0 = randomValue & 1; -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/
Message
Re: [AVR-Chat] C Question in AVR GCC and codevision
2007-06-18 by Dave Hylands