Search wiring.org.co:

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Name |

### const

Examples |
    const int a = 10;

    void setup()
    {
      Serial.begin(9600);
    }

    void loop()
    {
      Serial.println(a);  // outputs the value of a

      // uncommenting the following lines gives a copiler error
      // a = a + 1;

      delay(200);
    }
Description | The const qualifier is used to create read-only variable, const variables can not be assigned to. They must be initialized when declared. They are useful for the compiler to make optimizations when using it to declare pin numbers which are not likely to change in the code.
Syntax |
    const datatype variablename = initialvalue
Parameters |

datatype | any data type: int, double, long, char, byte etc
variablename | a valid variable name
initialvalue | a valid value for the type of variable

Usage | Application

Updated on July 07, 2011 11:08:01pm PDT