Arduino Programming Language: Assignment

Description

Assign a value to a variable. This operator is formally called the assignment operator.

Syntax

var = value;

Parameters

  • var: any valid variable name
  • value: any value of the same type as the variable. For example, if the variable is of type "char", the value must also be a char.

Usage

Application

Examples

int x; //declare an integer variable named x
x=5; //store the value 5 in x

Note: The declared variable, needs to be able to hold the value stored in it.

Related Functions


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc