If you right-shift an 8-bit variable 7 times, you get 1 or 0 according
to the most significant bit.
 
Regards,
 
    Harri

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dipti
Sent: Monday, April 30, 2007 8:13 AM
To: Jay Taneja
Cc: tinyos forum
Subject: Re: [Tinyos-help] wt does this mean: rcopy >> 7


Hi ,
 
Thnks for the reply Jay, what i really wanted to ask is why is the value
of the variable rCopy being right shifted 7 times.,  The IntOutput
interface can output an 8 bit integer and when the value of rCopy is
right shifted 7 times it becomes a no. with 9 bits.. so how can we use
IntOutput interface to output the same? 
 
Dipti Jaiswal
 

        ----- Original Message ----- 
        From: Jay Taneja <mailto:[EMAIL PROTECTED]>  
        To: Dipti <mailto:[EMAIL PROTECTED]>  
        Cc: tinyos forum <mailto:[email protected]>  
        Sent: 2007 Apr 30 10:09 AM
        Subject: Re: [Tinyos-help] wt does this mean: rcopy >> 7

        >> is a bitwise shift operator, meaning shift the value of rCopy
to the right by 7 bits. Here's a website that documents the C operator:
        
        
http://www.phim.unibe.ch/comp_doc/c_manual/C/CONCEPT/bit_shift.html#shif
t
        
        Cheers.
        
        -jay
        
        
        On 4/29/07, Dipti < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

                Hi all,
                 
                I was going thru the sensetorfm component. I could not
follow a few lines in the code.
                Can someone help me with understanding this..
                 
                 
                void task outputTask() {
                    uint16_t rCopy;
                    atomic {
                      rCopy = reading;
                    }
                    call IntOutput.output(rCopy >> 7); /* what does
rCopy >>7 denote? */
                  }
                Thanks in advance
                 
                Dipti Jaiswal.

                  

                _______________________________________________
                Tinyos-help mailing list
                [email protected] 
        
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-hel
p 
                


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to