variables and constant

 A Variable is a region of the program and there are three places where variables can be declared.

    1. local variables- Inside a function or a block.
    2. formal parameters In the definition of function parameters.
    3. global variables Outside of all functions.
Examples in a program.



local variables


Void setup () {

}

Void loop () {
   int A , B , C; Local variable declaration
   
   A = 1;
   B = 2; actual initialization
   C = 20;
}


Global Variables


Int D , W ;
float Z = 0 ; Global variable declaration

Void setup () {

}

Void loop () {
   int A , B , C; Local variable declaration
   
   A = 1;
   B = 2; actual initialization
   C = 20;
}





Learn more


Comments

Popular posts from this blog

Arduino function libraries~Math Library Function

Project Four: Pattern, Blink 4 leds using Arduino board

Project 6: Arduino print hello