Articles Posted in the " " Category

  • bitWrite()

    bitWrite()

    描述 对一个数字中的某个位元写值。 语法 bitWrite(x, n, b) 参数 x: 要写入的数字。 n: 指定写入的位元,从 0 开始算起,而 0 则对应最低有效位 (最右边的位元)。 b: 要写入的位元值 (0 或 1)。 回传 无回传值 See also - bit() - bitRead() - bitSet() - bitClear() 语法参考主页面 本页由热血青年 LBU 译自英文版。 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a […]


  • bitRead()

    bitRead()

    描述 读取一个数字中的某个位元。 语法 bitRead(x, n) 参数 x: 要读取的数字。 n: 指定读取的位元,从 0 开始算起,而 0 则对应最低有效位 (最右边的位元)。 回传 该位元的值 (0 或 1) See also - bit() - bitWrite() - bitSet() - bitClear() 语法参考主页面 本页由热血青年 LBU 译自英文版。 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike […]


  • highByte()

    highByte()

    描述 撷取一个 word 中的高位元组 (最左边的位元组,或者一个更大的资料型别中的第二低的位元组)。 语法 highByte(x) 参数 x: 一个任意型别的数值 回传 byte See also - lowByte() - word() 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 released into the public […]


  • lowByte()

    lowByte()

    描述 撷取一个变数中的低位元组 (例如一个 word 中最右边的位元组)。 语法 lowByte(x) 参数 x: 一个任意型别的数值 回传 byte See also - highByte() - word() 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 released into the public […]


  • random()

    random()

    描述 random 函式会产生一个伪随机性的数字。 语法 random(max) random(min, max) 参数 min 随机值的下限,包含下限 (非必要) max 随机值的上限,不包含上限 回传 一个介于 min 到 max-1 之间的数字 (资料型别是 long) 注意 如果希望由 random() 产生的数字具有高随机性,在程式码中可以用 randomSeed() 去引入一个真正随机的输入,数值的随机性就如同 pin 脚上不接类比输入电压就呼叫 analogRead()。 相反的,它的伪随机性在需要重现相同行为时非常有用;可以在每一次开始随机序列之前呼叫 randomSeed() 并给它固定的参数值。 范例 See also - randomSeed() 语法参考主页面 本页由热血青年 LBU 译自英文版。 The text of the 86Duino reference is a modification of the Arduino reference, […]


  • randomSeed(seed)

    randomSeed(seed)

    描述 randomSeed() 会初始化一个伪随机数字产生器,让它在随意一个点开始产生有顺序的乱数,这个顺序规律非常长而且随机性高。但此序列并不会改变,若是从同一个点开始,可以得到一样的数字。 如果希望由 random() 产生的数字具有高随机性,在程式码中可以用 randomSeed() 去引入一个真正随机的输入,数值的随机性就如同 pin 脚上不接类比输入电压就呼叫 analogRead()。 相反的,它的伪随机性在需要重现相同行为时非常有用;可以在每一次开始随机序列之前呼叫 randomSeed() 并给它固定的参数值。 参数 long, int 传一个数字去产生随机种子 回传 无回传值 范例 See also - random() 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 […]


  • sin(rad)

    sin(rad)

    描述 计算角度 (弧度) 的正弦值。结果将会在 -1.0 到 1.0 之间。 参数 rad: rad 代表弧度角,型别是 double。 回传 角度 (double 型别) 的正弦值。  See also - cos() - tan() - double 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 […]


  • cos(rad)

    cos(rad)

    描述 计算角度 (弧度) 的余弦。结果将会在 -1.0 到 1.0 之间。 参数 rad 代表弧度角,型别是double。 回传 角度 (double 型别) 的余弦。 See also - sin() - tan() - double 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 […]


  • tan(rad)

    tan(rad)

    描述 计算角度 (弧度) 的正切。结果将会在负无穷大到无穷大之间。 参数 rad 代表弧度角,型别是double。 回传 角度 (double 型别) 的正切 See also - sin() - cos() - double 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 released into […]


  • abs(x)

    abs(x)

    描述 计算出一个数值的绝对值。 参数 x: 欲计算的数值 回传 x: 若 x 大于或等于零 -x: 若 x 小于零 警告 由于 abs() 函式实作方法 (使用巨集) 的关系,在括号 () 中避免使用其他函式或运算,否则可能产生不正确的结果。 语法参考主页面 本页由热血青年 LBU 译自英文版。 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 […]