https://wiki.microduinoinc.com/index.php?title=%3D_(Basic_assignment)&feed=atom&action=history= (Basic assignment) - Revision history2024-03-29T13:46:09ZRevision history for this page on the wikiMediaWiki 1.28.2https://wiki.microduinoinc.com/index.php?title=%3D_(Basic_assignment)&diff=14310&oldid=prevFengfeng: Created page with "*'''= assignment operator(single equal sign)''' Assignment operator(single equal sign) Assign the numerical value on the right of the equal sing to the variable on th..."2016-08-05T05:10:25Z<p>Created page with "*'''= assignment operator(single equal sign)''' Assignment operator(single equal sign) Assign the numerical value on the right of the equal sing to the variable on th..."</p>
<p><b>New page</b></p><div>*'''= assignment operator(single equal sign)'''<br />
Assignment operator(single equal sign)<br />
<br />
Assign the numerical value on the right of the equal sing to the variable on the left of it. <br />
<br />
In C, single equal sign is called as assignment operator whose meaning is different from mathematical one. It tells the microcontroller to store the numerical value or the result of the calculation expression on the right of the equal sign in the variable on the left of the equal sign. <br />
<br />
*'''Example:'''<br />
<pre style="color:green"><br />
<br />
int sensVal; //claim a integer variable called sensVal<br />
senVal = analogRead(0); //store the input voltage of analog pin 0 in variable SensVal<br />
</pre><br />
<br />
*'''Note:'''<br />
<br />
Make sure that the variable on the left of the assignment operator can save the numerical value on the right. If it isn’t large enough to save the value, the value saved in the variable will be mistaken. <br />
<br />
Don’t mix up the assignment operator [=](single equal sign)and comparison operator[==](double equal signs), which means the two expressions are equal. <br />
<br />
<br />
[[https://wiki.microduino.cc/index.php/Arduino_Syntax_Manual Return to Arduino Syntax Manual]]</div>Fengfeng