From 2d429e75ce69e77f8c95490ac03881ec9aa0354a Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 25 Oct 2010 21:15:28 -0400 Subject: arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed --- source/arduino/byte.rst | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'source/arduino/byte.rst') 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 `_ -- `byte `_\ () -- `Variable Declaration `_ - +- :ref:`byte() ` (casting a value to a byte) +- :ref:`Variables ` -- cgit v1.2.3