Articles Posted by the Author:

  • random()

    random()

    Description The random function generates pseudo-random numbers. Syntax random(max) random(min, max) Parameters min – lower bound of the random value, inclusive (optional) max – upper bound of the random value, exclusive Returns a random number between min and max-1 (long) Note If it is important for a sequence of values generated by random() to differ, […]


  • randomSeed(seed)

    randomSeed(seed)

    Description randomSeed() initializes the pseudo-random number generator, causing it to start at an arbitrary point in its random sequence. This sequence, while very long, and random, is always the same. If it is important for a sequence of values generated by random() to differ, on subsequent executions of a sketch, use randomSeed() to initialize the […]


  • sin(rad)

    sin(rad)

    Description Calculates the sine of an angle (in radians). The result will be between -1.0 and 1.0. Parameters rad: the angle in radians (double) Returns the sine of the angle (double) See also - cos() - tan() - double Language Reference Home The text of the 86Duino reference is a modification of the Arduino reference, […]


  • cos(rad)

    cos(rad)

    Description Calculates the cos of an angle (in radians). The result will be between -1.0 and 1.0. Parameters rad: the angle in radians (double) Returns The cos of the angle (double) See also - sin() - tan() - double Language Reference Home The text of the 86Duino reference is a modification of the Arduino reference, […]


  • tan(rad)

    tan(rad)

    Description Calculates the tangent of an angle (in radians). The result will be between negative infinity and infinity. Parameters rad: the angle in radians (double) Returns The tangent of the angle (double) See also - sin() - cos() - double Language Reference Home The text of the 86Duino reference is a modification of the Arduino […]


  • abs(x)

    abs(x)

    Description Computes the absolute value of a number. Parameters x: the number Returns x: if x is greater than or equal to 0. -x: if x is less than 0. Warning Because of the way the abs() function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results. Language Reference […]


  • constrain(x, a, b)

    constrain(x, a, b)

    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: […]


  • map(value, fromLow, fromHigh, toLow, toHigh)

    map(value, fromLow, fromHigh, toLow, toHigh)

    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 […]


  • pow(base, exponent)

    pow(base, exponent)

    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 […]


  • sqrt(x)

    sqrt(x)

    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 […]