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 | 2d429e75ce69e77f8c95490ac03881ec9aa0354a (patch) | |
tree | a3b810a6c75625b07a4b976e5d1e319c60e19a6b /source/arduino/byte.rst | |
parent | 30ac55d80c18e93f9c39a6dd850c10f9e7fd92ac (diff) | |
download | librambutan-2d429e75ce69e77f8c95490ac03881ec9aa0354a.tar.gz librambutan-2d429e75ce69e77f8c95490ac03881ec9aa0354a.zip |
arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed
Diffstat (limited to 'source/arduino/byte.rst')
-rw-r--r-- | source/arduino/byte.rst | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source/arduino/byte.rst b/source/arduino/byte.rst index 5e94bd4..0b21b31 100644 --- a/source/arduino/byte.rst +++ b/source/arduino/byte.rst @@ -1,13 +1,20 @@ +.. highlight:: cpp + .. _arduino-byte: byte ==== -Description ------------ +The ``byte`` type stores a 1-byte (8-bit) unsigned integer number, +from 0 to 255. -A byte stores an 8-bit unsigned number, from 0 to 255. +.. warning:: + The ``byte`` type is provided for compatibility with Arduino. + However, it is a non-standard extension. The standard C++ type for + storing an 8-bit unsigned integer is ``unsigned char``; we + recommend using that instead. (Your code will still work on an + Arduino). Example @@ -15,15 +22,10 @@ Example :: - byte b = B10010; // "B" is the binary formatter (B10010 = 18 decimal) - - + byte b = 134; -See also +See Also -------- - -- `word <http://arduino.cc/en/Reference/Word>`_ -- `byte <http://arduino.cc/en/Reference/ByteCast>`_\ () -- `Variable Declaration <http://arduino.cc/en/Reference/VariableDeclaration>`_ - +- :ref:`byte() <arduino-bytecast>` (casting a value to a byte) +- :ref:`Variables <arduino-variables>` |