Description Constrains a number to be within a range. Parameters x: the number to constrain, all data types a: the lower end of the range, all data types b: the upper end of the range, all data types Returns x: if x is between a and b a: if x is less than a b: […]
Description Re-maps a number from one range to another. That is, a value of fromLow would get mapped to toLow, a value of fromHigh to toHigh, values in-between to values in-between, etc. Does not constrain values to within the range, because out-of-range values are sometimes intended and useful. The constrain() function may be used either […]
Description Calculates the value of a number raised to a power. pow() can be used to raise a number to a fractional power. This is useful for generating exponential mapping of values or curves. Parameters base: the number (double) exponent: the power to which the base is raised (double) Returns The result of the exponentiation […]
Description Calculates the square root of a number. Parameters x: the number (double) Returns double, the number’s square root. See also - pow() Language Reference Home The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are […]
Description Calculates the maximum of two numbers. Parameters x: the first number, any data type y: the second number, any data type Returns The larger of the two parameter values. Example Note Perhaps counter-intuitively, max() is often used to constrain the lower end of a variable’s range, while min() is used to constrain the upper […]
Description Calculates the minimum of two numbers. Parameters x: the first number, any data type y: the second number, any data type Returns The smaller of the two numbers. Example Note Perhaps counter-intuitively, max() is often used to constrain the lower end of a variable’s range, while min() is used to constrain the upper end […]
Description Pauses the program for the amount of time (in microseconds) specified as parameter. There are a thousand microseconds in a millisecond, and a million microseconds in a second. Currently, the largest value that will produce an accurate delay is about 4000000. This could change in future 86Duino releases. For delays longer than a few […]
Description Returns the number of microseconds since the 86Duino board began running the current program. This number will overflow (go back to zero), after approximately 70 minutes. This function has a resolution of one microsecond. Note: there are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second. Parameters None Returns Number of microseconds […]
Description Pauses the program for the amount of time (in miliseconds) specified as parameter. (There are 1000 milliseconds in a second.) Syntax delay(ms) Parameters ms: the number of milliseconds to pause (unsigned long) Returns nothing Example Caveat While it is easy to create a blinking LED with the delay() function, and many sketches use short […]
Description Returns the number of milliseconds since the 86Duino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Parameters None Returns Number of milliseconds since the program started (unsigned long) Example Tip : Note that the parameter for millis is an unsigned long, errors may be […]