aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/arduino/byte.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source/arduino/byte.rst')
-rw-r--r--docs/source/arduino/byte.rst26
1 files changed, 14 insertions, 12 deletions
diff --git a/docs/source/arduino/byte.rst b/docs/source/arduino/byte.rst
index 5e94bd4..0b21b31 100644
--- a/docs/source/arduino/byte.rst
+++ b/docs/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>`