Breaking
Loading...
Arduino සිංහලෙන් - V

Arduino සිංහලෙන් - V

2. Arduino - Variables & Constants ( විචල්‍යය සහ නියත )




Arduino වල භාවිතා වන C වැඩසටහනකරණ භාෂාවේ ඇති විචල්‍යයන් වල විශේෂ ලක්ෂණයක් (property) ඇත. එය scope එකක් ලෙස හඳුන්වයි.scope එකක් යනු වැඩසටහනක විචල්‍යයන් කොටස් වන අතර මෙහිදී අපට එවැනි කොටස් තුනක් ගැන කතා කරන්න තිබෙනවා.

1. Inside a function or a block, which is called local variables.
ශ්‍රිතයක් ඇතුලත ඇතිවිට එයට local variable එක්ක යයි කියනු ලැබේ.

Void setup () {

}

Void loop () {
   int x , y ;
   int z ; Local variable declaration
   x = 0;
   y = 0; actual initialization
   z = 10;
}

2.In the definition of function parameters, which is called formal parameters.
ශ්‍රිත පරාමිතියක් තුල ඇතිවිට formal parameter යයි කියනු ලැබේ.

3. Outside of all functions, which is called global variables.
ශ්‍රිතයකින් පිටත ඇතිවිට global variable එක්ක යයි කියනු ලැබේ.

Int T , S ;
float c = 0 ; Global variable declaration

Void setup () {

}

Void loop () {
   int x , y ;
   int z ; Local variable declaration
   x = 0;
   y = 0; actual initialization
   z = 10;
}

Arduino - Operators

Operator එකක් යනු කිසියම් ගණිත කර්මයක් කිරීමට අවශ්‍ය වන සම්බන්ධය ගොඩ නඟන සංකේතයයි. එවැනි Operators පහක් ඇත.

Arithmetic Operators


Comparison Operators


Boolean Operators


Bitwise Operators


Compound Operators