February 2009
Beginner
128 pages
2h 45m
English
You can use Arduino to make complex calculations using a special syntax. + and – work like you've learned in school, and multiplication is represented with an * and division with a /.
There is an additional operator called "modulo" (%), which returns the remainder of an integer division. You can use as many levels of parentheses as necessary to group expressions. Contrary to what you might have learned in school, square brackets and curly brackets are reserved for other purposes (array indexes and blocks, respectively).
Examples:
a = 2 + 2; light = ((12 * sensorValue) - 5 ) / 2; remainder = 3 % 2; // returns 2 because 3 / 2 has remainder 1
Read now
Unlock full access