Integer constants are numbers used directly in a sketch, like 123. By default, these numbers are treated as int‘s but you can change this with the U and L modifiers (see below). Normally, integer constants are treated as base 10 (decimal) integers, but special notation (formatters) may be used to enter numbers in other bases. […]
Constants are predefined variables in the 86Duino language. They are used to make the programs easier to read. We classify constants in groups. Defining Logical Levels, true and false (Boolean Constants) There are two constants used to represent truth and falsity in the 86Duino language: true, and false. false false is the easier of the […]
Description The compound bitwise OR operator (|=) is often used with a variable and a constant to “set” (set to 1) particular bits in a variable. Syntax x |= y; // equivalent to x = x | y; Parameters x: a char, int or long variable y: an integer constant or char, int, or long […]
Description The compound bitwise AND operator (&=) is often used with a variable and a constant to force particular bits in a variable to the LOW state (to 0). This is often referred to in programming guides as “clearing” or “resetting” bits. Syntax x &= y; // equivalent to x = x & y; Parameters […]
Description Perform a mathematical operation on a variable with another constant or variable. The += (et al) operators are just a convenient shorthand for the expanded syntax, listed below. Syntax x += y; // equivalent to the expression x = x + y; x -= y; // equivalent to the expression x = x - […]
Description Increment or decrement a variable Syntax x++; // increment x by one and returns the old value of x ++x; // increment x by one and returns the new value of x x-- ; // decrement x by one and returns the old value of x --x ; // decrement x by one and […]
Description There are two bit shift operators in C++: the left shift operator >. These operators cause the bits in the left operand to be shifted left or right by the number of positions specified by the right operand. More on bitwise math may be found here. Syntax variable > number_of_bits Parameters variable: (byte, int, […]
The bitwise NOT operator in C++ is the tilde character ~. Unlike & and |, the bitwise NOT operator is applied to a single operand to its right. Bitwise NOT changes each bit to its opposite: 0 becomes 1, and 1 becomes 0. For example: 0 1 operand1 ———- 1 […]
The bitwise operators perform their calculations at the bit level of variables. They help solve a wide range of common programming problems. Much of the material below is from an excellent tutorial on bitwise math wihch may be found here. Description and Syntax Below are descriptions and syntax for all of the operators. Further details […]
Pointers are one of the more complicated subjects for beginners in learning C, and it is possible to write the vast majority of 86Duino sketches without ever encountering pointers. However for manipulating certain data structures, the use of pointers can simplify the code, and knowledge of manipulating pointers is handy to have in one’s toolkit. […]