Shifting operations might seem intuitive, but you have to be careful when
shifting signed values.
the same as Boolean operators. Boolean operators such as && and || don t
operate on the bit level. They implement the rules of Boolean algebra.
Beginners are often afraid of bit operations, but there s no reason to fear
them. Microcontrollers operate on a bit level, so you have to be able to make
the bits obey your will. It takes some training, but it s not rocket science.
2.
http://en.wikipedia.org/wiki/Arithmetic_shift
3.
http://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29
Appendix 2. Advanced Arduino Programming
2
Although they look similar, binary operators aren t
www.it-ebooks.info
252
3
report erratum
discuss
Need help?
Do you have a question about the Arduino Uno and is the answer not in the manual?