View Single Post
  #3   Spotlight this post!  
Unread 03-02-2005, 12:01
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Some things i'm trying to understand on Kevin's Accelerometer Code

Quote:
Originally Posted by Squall
Code:
	adc_result = ADRESH;
	adc_result <<= 8;
	adc_result += ADRESL;
We've understood that it's reading the High bits of the ADC and then it'll copy it do the lower part of the adc_result variable, this part I really can't understand.
The <<= "left shift" operator moves the value toward the upper part of the variable. With that correction, you should understand the code fine now.