NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » what the heck does << mean?
January 29, 2010 by Ralphxyz |
Sorry I am new to C programming and didn't get far in High Scholl math (algebra 1 D) so some symbols (notations) throw me.
What exactly does this say? Is the << in 1. the same as the << in 2.? Thanks for your tolerante help, Ralph |
---|---|
January 29, 2010 by treymd |
it is bitwise arithmetic. basically in that operation you are shifting bits 3 to the left. 0000 0001 becomes 0000 1000 |
January 29, 2010 by treymd |
There are a few other operators that work on the bit level in C, working on bits is important when dealing with microcontrollers because you are literally controlling pins with a single bit and you need to play some games to isolate and operate on the one(s) you need while leaving the others alone. Getting good with bitwise operations will give you tremendous power over what the MCU does. here is a decent reference (a little wordy, but it has it all) http://www.cprogramming.com/tutorial/bitwise_operators.html |
January 29, 2010 by Ralphxyz |
Thanks for the rapid replies. The << is the left shift operator a >> would be a right shift operator. Way way back in the depths of my mind I knew that buts thanks alot for the help. Ralph |
Please log in to post a reply.
Did you know that you can adjust most wire strippers to make it easier to strip insulation faster? Learn more...
|