Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Solved! Re: ATmega 168 Timer 1 mode 14, fast PWM, problem

2007-04-09 by Dave Hylands

Hi John,

On 4/9/07, John Samperi <samperi@ampertronics.com.au> wrote:
> At 08:13 PM 9/04/2007, you wrote:
> >(1<CS11) | (0<CS10);  // Missing '<' !!!!
>
> Didn't the compiler complain? Or are both << and < acceptable?

Both are acceptable.

(a < b) is an expression that yields 1 if a is < b and 0 otherwise.

It's just as valid to do:

int x = a < b;
if ( x )
{
   ...blah...
}

as it is to do:

if ( a < b )
{
   ...blah...
}

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.