diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-25 21:15:28 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-11-17 12:44:28 -0500 |
commit | 95783b750fda95f5f4c1fac00ab24da03b31b517 (patch) | |
tree | 2b0bf89c101aa58af5796fbe76c7ec98eebbb0a5 /docs/source/arduino/highbyte.rst | |
parent | 3a9a119e9a8ce72c0e1b8fa4d3904bdf84ce355c (diff) | |
download | librambutan-95783b750fda95f5f4c1fac00ab24da03b31b517.tar.gz librambutan-95783b750fda95f5f4c1fac00ab24da03b31b517.zip |
arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed
Diffstat (limited to 'docs/source/arduino/highbyte.rst')
-rw-r--r-- | docs/source/arduino/highbyte.rst | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/docs/source/arduino/highbyte.rst b/docs/source/arduino/highbyte.rst index dc6a1d6..0682391 100644 --- a/docs/source/arduino/highbyte.rst +++ b/docs/source/arduino/highbyte.rst @@ -1,42 +1,50 @@ .. _arduino-highbyte: -highByte() -========== - -Description ------------ - -Extracts the high-order (leftmost) byte of a word (or the second -lowest byte of a larger data type). - - +highByte(x) +=========== -Syntax ------- +.. warning:: This macro is provided for compatibility with Arduino + only. It returns the second-least significant byte in an integral + value. It makes sense to call this the "high" byte on a 16-bit + microcontroller like the Atmel chips on Arduinos, but it makes no + sense at all on a 32-bit microcontroller like the STM32s in the + Maple line. -highByte(x) + In short: we provide this so that existing Arduino code works as + expected, but **strongly discourage its use** in new programs. +Description +----------- +(Macro) Extracts the second lowest byte of an integral data type. Parameters ---------- -x: a value of any type +**x**: a value of any integral type. +Returns +------- +Second lowest byte in **x**. -Returns +Example ------- -byte +:: + + int x = 0xDEADBEEF; + SerialUSB.println(x, HEX); // prints "BE" +Arduino Compatibility +--------------------- +The Maple version of ``highByte()`` is compatible with Arduino. -See also +See Also -------- +- :ref:`lowByte() <arduino-lowbyte>` -- `lowByte <http://arduino.cc/en/Reference/LowByte>`_\ () -- `word <http://arduino.cc/en/Reference/WordCast>`_\ () |