Searching \ for '[AVR] Quick C question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'Quick C question'.

Exact match. Not showing close matches.
PICList Thread
'[AVR] Quick C question'
2007\03\06@185139 by Chris McSweeny

picon face
Checking the include file PB1 is shorthand for PORTB1 - ie pin 1 on the port
- and is defined as the number 1. Therefore (1<<PB1) translates as 1 left
shifted 1 place (ie 2), which creates a bit mask for pin 1. IMO it should
really be written (1<<PINB1), since that's what it's creating the mask for.
Effectively that statement is testing pin 1 on port B.

On 3/6/07, Mauricio Jancic <> wrote:
{Quote hidden}

> -

2007\03\06@192732 by Chris McSweeny

picon face
Look in the include file for the definitions of constants like this.

On 3/7/07, Mauricio Jancic <> wrote:
> Yes, I knew it was a bit shift, but I didn't understand de PB1 and why was
> shifting PB1 1 time to the left (here you can see my mistake)...
> 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
> Mauricio
> > {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...