short

Description

A short is a 16-bit data-type.

On all Arduino boards (ATMega and ARM based) a short stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1).

Syntax

short var = val;

Parameters

  • var
    : variable name
  • val
    : the value you assign to that variable

Example Code

1short ledPin = 13

See also

Suggest changes

The content on docs.arduino.cc is facilitated through a public GitHub repository. If you see anything wrong, you can edit this page here.

License

The Arduino documentation is licensed under the Creative Commons Attribution-Share Alike 4.0 license.