Articles Posted by the Author:

  • analogWriteResolution()

    analogWriteResolution()

    analogWriteResolution() Description analogWriteResolution() is an extension of the Analog API for the Arduino Due. analogWriteResolution() sets the resolution of the analogWrite() function. It defaults to 8 bits (values between 0-255) for backward compatibility with AVR based boards. The Due has the following hardare capabilities: 12 pins which default to 8-bit PWM, like the AVR-based boards. […]


  • analogReadResolution()

    analogReadResolution()

    analogReadResolution() Description analogReadResolution() is an extension of the Analog API for the Arduino Due. Sets the size (in bits) of the value returned by analogRead(). It defaults to 10 bits (returns values between 0-1023) for backward compatibility with AVR based boards. The Due has 12-bit ADC capabilities that can be accessed by changing the resolution […]


  • analogWrite() – PWM

    analogWrite() – PWM

      analogWrite() Description Writes an analog value (PWM wave) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds. After a call to analogWrite(), the pin will generate a steady square wave of the specified duty cycle until the next call to analogWrite() (or a […]


  • analogRead()

    analogRead()

      analogRead() Description Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This […]


  • analogReference(type)

    analogReference(type)

    描述 对 Arduino 来说这个函式是用来设定输入的参考电压,但在 86Duino 上不支援这个函式,呼叫此函式不会有任何作用 (这个函式因为 Arduino 的相容性而被保留下来) 参数 type: DEFAULT,INTERNAL,INTERNAL1V1,INTERNAL2V56,EXTERNAL。但是这些参数只作用在 Arduino 上,在 86Duino 上是没有用的。 回传 无回传值 See also - Description of the analog input pins - analogRead() 语法参考主页面 本页由热血青年 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 […]


  • digitalRead()

    digitalRead()

      digitalRead() Description Reads the value from a specified digital pin, either HIGH or LOW. Syntax digitalRead(pin) Parameters pin: the number of the digital pin you want to read (int) Returns HIGH or LOW Example int ledPin = 13; // LED connected to digital pin 13 int inPin = 7; // pushbutton connected to digital […]


  • digitalWrite()

    digitalWrite()

      digitalWrite() Description Write a HIGH or a LOW value to a digital pin. If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW. If the pin is configured as an INPUT, writing […]


  • pinMode()

    pinMode()

      pinMode() Description Configures the specified pin to behave either as an input or an output. See the description of digital pins for details on the functionality of the pins. As of Arduino 1.0.1, it is possible to enable the internal pullup resistors with the mode INPUT_PULLUP. Additionally, the INPUT mode explicitly disables the internal […]


  • sizeof()

    sizeof()

      sizeof Description The sizeof operator returns the number of bytes in a variable type, or the number of bytes occupied by an array. Syntax sizeof(variable) Parameters variable: any variable type or array (e.g. int, float, byte) Example code The sizeof operator is useful for dealing with arrays (such as strings) where it is convenient […]


  • const

    const

      const keyword The const keyword stands for constant. It is a variable qualifier that modifies the behavior of the variable, making a variable read-only. This means that the variable can be used just as any other variable of its type, but its value cannot be changed. You will get a compiler error if you […]