This week on Adventures in Science, we look at the various arithmetic operators in C and C++, specifically, as they're used in the Arduino environment. There are only 6 main operators: assignment, addition, subtraction, multiplication, division, and modulo. We also look at compound assignment operators; how they can be used to perform a math operation on a variable and then store the result back in the same variable.
Language Reference:
Language Reference:
Arduino programs can be divided in three main parts: structure, values (variables and constants), and functions.
StructureControl StructuresFurther Syntax
Arithmetic OperatorsComparison Operators
Boolean OperatorsPointer Access OperatorsBitwise Operators
Compound Operators |
VariablesConstants
Data Types
ConversionVariable Scope & QualifiersUtilities |
FunctionsDigital I/O
Analog I/O
Due & Zero onlyAdvanced I/OTime
MathTrigonometryCharacters
Random Numbers
Bits and BytesExternal InterruptsInterruptsCommunicationUSB (32u4 based boards and Due/Zero only)Looking for something else?
See the libraries page for interfacing with particular types of hardware. Try the list of community-contributed code. The Arduino language is based on C/C++. It links against AVR Libc and allows the use of any of its functions; see its user manualfor details.
|
댓글 없음:
댓글 쓰기