<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://wiki.nxez.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.nxez.com/feed.php">
        <title>创客百科 en:arduino:language</title>
        <description></description>
        <link>https://wiki.nxez.com/</link>
        <image rdf:resource="https://wiki.nxez.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-04-08T11:08:27+08:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:abs?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:analogread?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:analogreference?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:analogwrite?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:arithmetic?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:arrays?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:assignment?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:assignment_operator?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:attachinterrupt?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bit?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitclear?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitread?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitset?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitshift?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitwiseand?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitwisecompoundand?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitwisecompoundor?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitwisexornot?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bitwrite?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:boolean?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:booleanvariables?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:braces?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:break?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:byte?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:bytecast?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:char?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:charcast?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:comments?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:const?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:constants?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:constrain?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:continue?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:cos?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:define?rev=1482675300&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:delay?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:delaymicroseconds?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:detachinterrupt?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:digitalread?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:digitalwrite?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:double?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:dowhile?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:else?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:float?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:floatcast?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:for?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:fpconstants?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:goto?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:highbyte?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:if?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:include?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:increment?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:incrementcompound?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:int?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:intcast?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:integerconstants?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:interrupts?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:long?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:longcast?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:loop?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:lowbyte?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:map?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:max?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:micros?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:millis?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:min?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:modulo?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:nointerrupts?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:notone?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:pinmode?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:pointer?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:pow?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:pulsein?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:random?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:randomseed?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:return?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:scope?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:semicolon?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_available?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_begin?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_end?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_find?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_finduntil?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_flush?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_ifserial?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_parsefloat?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_parseint?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_peek?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_print?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_println?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_read?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_readbytes?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_readbytesuntil?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_settimeout?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:serial_write?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:setup?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:shiftin?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:shiftout?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:sin?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:sizeof?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:sqrt?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:static?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:string?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:stringobject?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:switchcase?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:tan?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:tone?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:unsignedchar?rev=1482675302&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:unsignedint?rev=1482675304&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:unsignedlong?rev=1482675304&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:void?rev=1482675304&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:volatile?rev=1482675304&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:while?rev=1482675304&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:word?rev=1482675304&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nxez.com/en:arduino:language:wordcast?rev=1482675304&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.nxez.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>创客百科</title>
        <link>https://wiki.nxez.com/</link>
        <url>https://wiki.nxez.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:abs?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:abs</title>
        <link>https://wiki.nxez.com/en:arduino:language:abs?rev=1482675300&amp;do=diff</link>
        <description>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.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:analogread?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:analogread</title>
        <link>https://wiki.nxez.com/en:arduino:language:analogread?rev=1482675300&amp;do=diff</link>
        <description>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 yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit. The input range and resolution can be changed using analogReference().</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:analogreference?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:analogreference</title>
        <link>https://wiki.nxez.com/en:arduino:language:analogreference?rev=1482675300&amp;do=diff</link>
        <description>analogReference(type)

Description

Configures the reference voltage used for analog input (i.e. the value used as the top of the input range). The options are:

	*  DEFAULT: the default analog reference of 5 volts (on 5V Arduino boards) or 3.3 volts (on 3.3V Arduino boards)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:analogwrite?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:analogwrite</title>
        <link>https://wiki.nxez.com/en:arduino:language:analogwrite?rev=1482675300&amp;do=diff</link>
        <description>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 call to digitalRead() or digitalWrite() on the same pin). The frequency of the PWM signal is approximately 490 Hz.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:arithmetic?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:arithmetic</title>
        <link>https://wiki.nxez.com/en:arduino:language:arithmetic?rev=1482675300&amp;do=diff</link>
        <description>Addition, Subtraction, Multiplication, &amp; Division

Description

These operators return the sum, difference, product, or quotient (respectively) of the two operands. The operation is conducted using the data type of the operands, so, for example, 9 / 4 gives 2 since 9 and 4 are ints. This also means that the operation can overflow if the result is larger than that which can be stored in the data type (e.g. adding 1 to an int with the value 32,767 gives -32,768). If the operands are of different t…</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:arrays?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:arrays</title>
        <link>https://wiki.nxez.com/en:arduino:language:arrays?rev=1482675300&amp;do=diff</link>
        <description>Arrays

An array is a collection of variables that are accessed with an index number. Arrays in the C programming language, on which Arduino is based, can be complicated, but using simple arrays is relatively straightforward.

Creating (Declaring) an Array</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:assignment?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:assignment</title>
        <link>https://wiki.nxez.com/en:arduino:language:assignment?rev=1482675300&amp;do=diff</link>
        <description>= assignment operator (single equal sign)

Stores the value to the right of the equal sign in the variable to the left of the equal sign.

The single equal sign in the C programming language is called the assignment operator. It has a different meaning than in algebra class where it indicated an equation or equality. The assignment operator tells the microcontroller to evaluate whatever value or expression is on the right side of the equal sign, and store it in the variable to the left of the eq…</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:assignment_operator?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:assignment_operator</title>
        <link>https://wiki.nxez.com/en:arduino:language:assignment_operator?rev=1482675300&amp;do=diff</link>
        <description>assignment operator (single equal sign)

Stores the value to the right of the equal sign in the variable to the left of the equal sign.

The single equal sign in the C programming language is called the assignment operator. It has a different meaning than in algebra class where it indicated an equation or equality. The assignment operator tells the microcontroller to evaluate whatever value or expression is on the right side of the equal sign, and store it in the variable to the left of the equa…</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:attachinterrupt?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:attachinterrupt</title>
        <link>https://wiki.nxez.com/en:arduino:language:attachinterrupt?rev=1482675300&amp;do=diff</link>
        <description>attachInterrupt(interrupt, function, mode)

Description

Specifies a function to call when an external interrupt occurs. Replaces any previous function that was attached to the interrupt. Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3). The Arduino Mega has an additional four: numbers 2 (pin 21), 3 (pin 20), 4 (pin 19), and 5 (pin 18).</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bit?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bit</title>
        <link>https://wiki.nxez.com/en:arduino:language:bit?rev=1482675300&amp;do=diff</link>
        <description>bit()

Description

Computes the value of the specified bit (bit 0 is 1, bit 1 is 2, bit 2 is 4, etc.).

Syntax

bit(n)

Parameters

n: the bit whose value to compute

Returns

the value of the bit

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitclear?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitclear</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitclear?rev=1482675300&amp;do=diff</link>
        <description>bitClear()

Description

Clears (writes a 0 to) a bit of a numeric variable.

Syntax

bitClear(x, n)

Parameters

x: the numeric variable whose bit to clear

n: which bit to clear, starting at 0 for the least-significant (rightmost) bit

Returns

none</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitread?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitread</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitread?rev=1482675300&amp;do=diff</link>
        <description>bitRead()

Description

Reads a bit of a number.

Syntax

bitRead(x, n)

Parameters

x: the number from which to read

n: which bit to read, starting at 0 for the least-significant (rightmost) bit

Returns

the value of the bit (0 or 1).

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitset?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitset</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitset?rev=1482675300&amp;do=diff</link>
        <description>bitSet()

Description

Sets (writes a 1 to) a bit of a numeric variable.

Syntax

bitSet(x, n)

Parameters

x: the numeric variable whose bit to set

n: which bit to set, starting at 0 for the least-significant (rightmost) bit

Returns

none

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitshift?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitshift</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitshift?rev=1482675300&amp;do=diff</link>
        <description>bitshift left (&lt;&lt;), bitshift right (&gt;&gt;)

Description

From The Bitmath Tutorial in The Playground

There are two bit shift operators in C++: the left shift operator &lt;&lt; and the right shift operator &gt;&gt;. 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.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitwiseand?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitwiseand</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitwiseand?rev=1482675300&amp;do=diff</link>
        <description>Bitwise AND (&amp;), Bitwise OR (|), Bitwise XOR (^)

Bitwise AND (&amp;)

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>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitwisecompoundand?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitwisecompoundand</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitwisecompoundand?rev=1482675300&amp;do=diff</link>
        <description>compound bitwise AND (&amp;=)

Description

The compound bitwise AND operator (&amp;=) 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 &quot;clearing&quot; or &quot;resetting&quot; bits.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitwisecompoundor?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitwisecompoundor</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitwisecompoundor?rev=1482675300&amp;do=diff</link>
        <description>compound bitwise OR (|=)

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</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitwisexornot?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitwisexornot</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitwisexornot?rev=1482675300&amp;do=diff</link>
        <description>Bitwise NOT (~)

The bitwise NOT operator in C++ is the tilde character ~. Unlike &amp; 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:</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bitwrite?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bitwrite</title>
        <link>https://wiki.nxez.com/en:arduino:language:bitwrite?rev=1482675300&amp;do=diff</link>
        <description>bitWrite()

Description

Writes a bit of a numeric variable.

Syntax

bitWrite(x, n, b)

Parameters

x: the numeric variable to which to write

n: which bit of the number to write, starting at 0 for the least-significant (rightmost) bit

b: the value to write to the bit (0 or 1)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:boolean?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:boolean</title>
        <link>https://wiki.nxez.com/en:arduino:language:boolean?rev=1482675300&amp;do=diff</link>
        <description>Boolean Operators

These can be used inside the condition of an if statement.

&amp;&amp; (logical and)

True only if both operands are true, e.g.


if (digitalRead(2) == HIGH  &amp;&amp; digitalRead(3) == HIGH) { // read two switches 
  // ...
} 


is true only if both inputs are high.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:booleanvariables?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:booleanvariables</title>
        <link>https://wiki.nxez.com/en:arduino:language:booleanvariables?rev=1482675300&amp;do=diff</link>
        <description>boolean

A boolean holds one of two values, true or false. (Each boolean variable occupies one byte of memory.)

Example


int LEDpin = 5;       // LED on pin 5
int switchPin = 13;   // momentary switch on 13, other side connected to ground

boolean running = false;

void setup()
{
  pinMode(LEDpin, OUTPUT);
  pinMode(switchPin, INPUT);
  digitalWrite(switchPin, HIGH);      // turn on pullup resistor
}

void loop()
{
  if (digitalRead(switchPin) == LOW)
  {  // switch is pressed - pullup keeps p…</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:braces?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:braces</title>
        <link>https://wiki.nxez.com/en:arduino:language:braces?rev=1482675300&amp;do=diff</link>
        <description>{} Curly Braces

Curly braces (also referred to as just “braces” or as “curly brackets”) are a major part of the C programming language. They are used in several different constructs, outlined below, and this can sometimes be confusing for beginners.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:break?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:break</title>
        <link>https://wiki.nxez.com/en:arduino:language:break?rev=1482675300&amp;do=diff</link>
        <description>break

break is used to exit from a do, for, or while loop, bypassing the normal loop condition. It is also used to exit from a switch statement.

Example


for (x = 0; x &lt; 255; x ++)
{
    digitalWrite(PWMpin, x);
    sens = analogRead(sensorPin);  
    if (sens &gt; threshold){      // bail out on sensor detect
       x = 0;
       break;
    }  
    delay(50);
}</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:byte?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:byte</title>
        <link>https://wiki.nxez.com/en:arduino:language:byte?rev=1482675300&amp;do=diff</link>
        <description>byte

Description

A byte stores an 8-bit unsigned number, from 0 to 255.

Example


    byte b = B10010;  // &quot;B&quot; is the binary formatter (B10010 = 18 decimal) 


Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:bytecast?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:bytecast</title>
        <link>https://wiki.nxez.com/en:arduino:language:bytecast?rev=1482675300&amp;do=diff</link>
        <description>byte()

Description

Converts a value to the byte data type.

Syntax

byte(x)

Parameters

x: a value of any type

Returns

	*  byte

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:char?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:char</title>
        <link>https://wiki.nxez.com/en:arduino:language:char?rev=1482675300&amp;do=diff</link>
        <description>char

Description

A data type that takes up 1 byte of memory that stores a character value. Character literals are written in single quotes, like this: 'A' (for multiple characters - strings - use double quotes: “ABC”).
Characters are stored as numbers however. You can see the specific encoding in the</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:charcast?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:charcast</title>
        <link>https://wiki.nxez.com/en:arduino:language:charcast?rev=1482675300&amp;do=diff</link>
        <description>char()

Description

Converts a value to the char data type.

Syntax

char(x)

Parameters

x: a value of any type

Returns

	*  char

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:comments?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:comments</title>
        <link>https://wiki.nxez.com/en:arduino:language:comments?rev=1482675300&amp;do=diff</link>
        <description>Comments

Comments are lines in the program that are used to inform yourself or others about the way the program works. They are ignored by the compiler, and not exported to the processor, so they don't take up any space on the Atmega chip.
Comments only purpose are to help you understand (or remember) how your program works or to inform others how your program works. There are two different ways of marking a line as a comment:</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:const?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:const</title>
        <link>https://wiki.nxez.com/en:arduino:language:const?rev=1482675300&amp;do=diff</link>
        <description>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 try to assign a value to a const variable.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:constants?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:constants</title>
        <link>https://wiki.nxez.com/en:arduino:language:constants?rev=1482675300&amp;do=diff</link>
        <description>constants

Constants are predefined variables in the Arduino 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 Arduino language: true, and false.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:constrain?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:constrain</title>
        <link>https://wiki.nxez.com/en:arduino:language:constrain?rev=1482675300&amp;do=diff</link>
        <description>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</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:continue?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:continue</title>
        <link>https://wiki.nxez.com/en:arduino:language:continue?rev=1482675300&amp;do=diff</link>
        <description>continue

The continue statement skips the rest of the current iteration of a loop (do, for, or while). It continues by checking the conditional expression of the loop, and proceeding with any subsequent iterations.

Example


for (x = 0; x &lt; 255; x ++)
{
    if (x &gt; 40 &amp;&amp; x &lt; 120){      // create jump in values
        continue;
    }

    digitalWrite(PWMpin, x);
    delay(50);
}</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:cos?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:cos</title>
        <link>https://wiki.nxez.com/en:arduino:language:cos?rev=1482675300&amp;do=diff</link>
        <description>cos(rad)

Description

Calculates the cos of an angle (in radians). The result will be between -1 and 1.

Parameters

rad: the angle in radians (float)

Returns

The cos of the angle (“double”)

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:define?rev=1482675300&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:00+08:00</dc:date>
        <title>en:arduino:language:define</title>
        <link>https://wiki.nxez.com/en:arduino:language:define?rev=1482675300&amp;do=diff</link>
        <description>Define

#define is a useful C component that allows the programmer to give a name to a constant value before the program is compiled. Defined constants in arduino don't take up any program memory space on the chip. The compiler will replace references to these constants with the defined value at compile time.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:delay?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:delay</title>
        <link>https://wiki.nxez.com/en:arduino:language:delay?rev=1482675302&amp;do=diff</link>
        <description>delay()

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</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:delaymicroseconds?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:delaymicroseconds</title>
        <link>https://wiki.nxez.com/en:arduino:language:delaymicroseconds?rev=1482675302&amp;do=diff</link>
        <description>delayMicroseconds()

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 16383. This could change in future Arduino releases. For delays longer than a few thousand microseconds, you should use delay() instead.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:detachinterrupt?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:detachinterrupt</title>
        <link>https://wiki.nxez.com/en:arduino:language:detachinterrupt?rev=1482675302&amp;do=diff</link>
        <description>detachInterrupt(interrupt)

Description

Turns off the given interrupt.

Parameters

interrupt: the number of interrupt to disable (0 or 1).

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:digitalread?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:digitalread</title>
        <link>https://wiki.nxez.com/en:arduino:language:digitalread?rev=1482675302&amp;do=diff</link>
        <description>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 pin 7
int val = 0;     // variable to store the read value

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin 13 as output
  pinMode(inPin, INPUT);   …</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:digitalwrite?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:digitalwrite</title>
        <link>https://wiki.nxez.com/en:arduino:language:digitalwrite?rev=1482675302&amp;do=diff</link>
        <description>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 a HIGH value with digitalWrite() will enable an internal 20K pullup resistor (see the tutorial on digital pins). Writing LOW will disable the pullup. The pullup resistor is enough to light an LED dimly, so …</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:double?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:double</title>
        <link>https://wiki.nxez.com/en:arduino:language:double?rev=1482675302&amp;do=diff</link>
        <description>double

Desciption

Double precision floating point number. Occupies 4 bytes.
The double implementation on the Arduino is currently exactly the same as the float, with no gain in precision.

Tip

Users who borrow code from other sources that includes double variables may wish to examine the code to see if the implied precision is different from that actually achieved on the Arduino.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:dowhile?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:dowhile</title>
        <link>https://wiki.nxez.com/en:arduino:language:dowhile?rev=1482675302&amp;do=diff</link>
        <description>do - while

The do loop works in the same manner as the while loop, with the exception that the condition is tested at the end of the loop, so the do loop will always run at least once.


do
{
    // statement block
} while (test condition);


Example</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:else?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:else</title>
        <link>https://wiki.nxez.com/en:arduino:language:else?rev=1482675302&amp;do=diff</link>
        <description>if / else

if/else allows greater control over the flow of code than the basic if statement, by allowing multiple tests to be grouped together. For example, an analog input could be tested and one action taken if the input was less than 500, and another action taken if the input was 500 or greater. The code would look like this:</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:float?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:float</title>
        <link>https://wiki.nxez.com/en:arduino:language:float?rev=1482675302&amp;do=diff</link>
        <description>float

Description

Datatype for floating-point numbers, a number that has a decimal point. Floating-point numbers are often used to approximate analog and continuous values because they have greater resolution than integers. Floating-point numbers can be as large as 3.4028235E+38 and as low as -3.4028235E+38. They are stored as 32 bits (4 bytes) of information.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:floatcast?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:floatcast</title>
        <link>https://wiki.nxez.com/en:arduino:language:floatcast?rev=1482675302&amp;do=diff</link>
        <description>float()

Description

Converts a value to the float data type.

Syntax

float(x)

Parameters

x: a value of any type

Returns

float

Notes

See the reference for float for details about the precision and limitations of floating point numbers on Arduino.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:for?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:for</title>
        <link>https://wiki.nxez.com/en:arduino:language:for?rev=1482675302&amp;do=diff</link>
        <description>for statements

Desciption

The for statement is used to repeat a block of statements enclosed in curly braces. An increment counter is usually used to increment and terminate the loop. The for statement is useful for any repetitive operation, and is often used in combination with arrays to operate on collections of data/pins.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:fpconstants?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:fpconstants</title>
        <link>https://wiki.nxez.com/en:arduino:language:fpconstants?rev=1482675302&amp;do=diff</link>
        <description>floating point constants

Similar to integer constants, floating point constants are used to make code more readable. Floating point constants are swapped at compile time for the value to which the expression evaluates.

Examples:


n = .005;


Floating point constants can also be expressed in a variety of scientific notation. 'E' and 'e' are both accepted as valid exponent indicators.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:goto?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:goto</title>
        <link>https://wiki.nxez.com/en:arduino:language:goto?rev=1482675302&amp;do=diff</link>
        <description>goto

Transfers program flow to a labeled point in the program

Syntax

label:
goto label; // sends program flow to the label

Tip

The use of goto is discouraged in C programming, and some authors of C programming books claim that the goto statement is never necessary, but used judiciously, it can simplify certain programs. The reason that many programmers frown upon the use of goto is that with the unrestrained use of goto statements, it is easy to create a program with undefined program flow,…</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:highbyte?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:highbyte</title>
        <link>https://wiki.nxez.com/en:arduino:language:highbyte?rev=1482675302&amp;do=diff</link>
        <description>highByte()

Description

Extracts the high-order (leftmost) byte of a word (or the second lowest byte of a larger data type).

Syntax

highByte(x)

Parameters

x: a value of any type
Returns
byte

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:if?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:if</title>
        <link>https://wiki.nxez.com/en:arduino:language:if?rev=1482675302&amp;do=diff</link>
        <description>if (conditional) and ==, !=, &lt;, &gt; (comparison operators)

if, which is used in conjunction with a comparison operator, tests whether a certain condition has been reached, such as an input being above a certain number. The format for an if test is:


if (someVariable &gt; 50)
{
  // do something here
}</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:include?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:include</title>
        <link>https://wiki.nxez.com/en:arduino:language:include?rev=1482675302&amp;do=diff</link>
        <description>#include

#include is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made functions), and also libraries written especially for Arduino.

The main reference page for AVR C libraries (AVR is a reference to the Atmel chips on which the Arduino is based) is here.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:increment?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:increment</title>
        <link>https://wiki.nxez.com/en:arduino:language:increment?rev=1482675302&amp;do=diff</link>
        <description>++ (increment) / -- (decrement)

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 returns the new value of x</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:incrementcompound?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:incrementcompound</title>
        <link>https://wiki.nxez.com/en:arduino:language:incrementcompound?rev=1482675302&amp;do=diff</link>
        <description>+= , -= , *= , /=

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 - y; 
x *= y;   // equivalent to the expression x = x * y; 
x /= y;   // equivalent to the expression x = x / y;</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:int?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:int</title>
        <link>https://wiki.nxez.com/en:arduino:language:int?rev=1482675302&amp;do=diff</link>
        <description>int

Description

Integers are your primary datatype for number storage, and store a 2 byte value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1).

Int's store negative numbers with a technique called 2's complement math. The highest bit, sometimes refered to as the</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:intcast?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:intcast</title>
        <link>https://wiki.nxez.com/en:arduino:language:intcast?rev=1482675302&amp;do=diff</link>
        <description>int()

Description

Converts a value to the int data type.

Syntax

int(x)

Parameters

x: a value of any type

Returns

int

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:integerconstants?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:integerconstants</title>
        <link>https://wiki.nxez.com/en:arduino:language:integerconstants?rev=1482675302&amp;do=diff</link>
        <description>Integer Constants

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.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:interrupts?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:interrupts</title>
        <link>https://wiki.nxez.com/en:arduino:language:interrupts?rev=1482675302&amp;do=diff</link>
        <description>interrupts()

Description

Re-enables interrupts (after they've been disabled by noInterrupts()). Interrupts allow certain important tasks to happen in the background and are enabled by default. Some functions will not work while interrupts are disabled, and incoming communication may be ignored. Interrupts can slightly disrupt the timing of code, however, and may be disabled for particularly critical sections of code.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:long?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:long</title>
        <link>https://wiki.nxez.com/en:arduino:language:long?rev=1482675302&amp;do=diff</link>
        <description>long

Description

Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647.

Example
  long speedOfLight = 186000L;   // see Integer Constants for explanation of the 'L'
Syntax</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:longcast?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:longcast</title>
        <link>https://wiki.nxez.com/en:arduino:language:longcast?rev=1482675302&amp;do=diff</link>
        <description>long()

Description

Converts a value to the long data type.

Syntax

long(x)

Parameters

x: a value of any type

Returns

long

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:loop?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:loop</title>
        <link>https://wiki.nxez.com/en:arduino:language:loop?rev=1482675302&amp;do=diff</link>
        <description>loop()

After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:lowbyte?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:lowbyte</title>
        <link>https://wiki.nxez.com/en:arduino:language:lowbyte?rev=1482675302&amp;do=diff</link>
        <description>lowByte()

Description

Extracts the low-order (rightmost) byte of a variable (e.g. a word).

Syntax

lowByte(x)

Parameters

x: a value of any type
Returns
byte

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:map?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:map</title>
        <link>https://wiki.nxez.com/en:arduino:language:map?rev=1482675302&amp;do=diff</link>
        <description>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 before or after this function, if limits to the ranges are desired.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:max?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:max</title>
        <link>https://wiki.nxez.com/en:arduino:language:max?rev=1482675302&amp;do=diff</link>
        <description>max(x, y)

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


sensVal = max(senVal, 20); // assigns sensVal to the larger of sensVal or 20
                           // (effectively ensuring that it is at least 20)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:micros?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:micros</title>
        <link>https://wiki.nxez.com/en:arduino:language:micros?rev=1482675302&amp;do=diff</link>
        <description>micros()

Description

Returns the number of microseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 70 minutes. On 16 MHz Arduino boards (e.g. Duemilanove and Nano), this function has a resolution of four microseconds (i.e. the value returned is always a multiple of four). On 8</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:millis?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:millis</title>
        <link>https://wiki.nxez.com/en:arduino:language:millis?rev=1482675302&amp;do=diff</link>
        <description>millis()

Description

Returns the number of milliseconds since the Arduino 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)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:min?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:min</title>
        <link>https://wiki.nxez.com/en:arduino:language:min?rev=1482675302&amp;do=diff</link>
        <description>min(x, y)

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.

Examples


sensVal = min(sensVal, 100); // assigns sensVal to the smaller of sensVal or 100
                             // ensuring that it never gets above 100.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:modulo?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:modulo</title>
        <link>https://wiki.nxez.com/en:arduino:language:modulo?rev=1482675302&amp;do=diff</link>
        <description>% (modulo)

Description

Calculates the remainder when one integer is divided by another. It is useful for keeping a variable within a particular range (e.g. the size of an array).

Syntax

result = dividend % divisor

Parameters

dividend: the number to be divided
divisor: the number to divide by</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:nointerrupts?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:nointerrupts</title>
        <link>https://wiki.nxez.com/en:arduino:language:nointerrupts?rev=1482675302&amp;do=diff</link>
        <description>noInterrupts()

Description

Disables interrupts (you can re-enable them with interrupts()). Interrupts allow certain important tasks to happen in the background and are enabled by default. Some functions will not work while interrupts are disabled, and incoming communication may be ignored. Interrupts can slightly disrupt the timing of code, however, and may be disabled for particularly critical sections of code.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:notone?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:notone</title>
        <link>https://wiki.nxez.com/en:arduino:language:notone?rev=1482675302&amp;do=diff</link>
        <description>noTone()

Description

Stops the generation of a square wave triggered by tone(). Has no effect if no tone is being generated.
NOTE: if you want to play different pitches on multiple pins, you need to call noTone() on one pin before calling tone() on the next pin.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:pinmode?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:pinmode</title>
        <link>https://wiki.nxez.com/en:arduino:language:pinmode?rev=1482675302&amp;do=diff</link>
        <description>pinMode()

Description

Configures the specified pin to behave either as an input or an output. See the description of digital pins for details.

Syntax

pinMode(pin, mode)

Parameters

pin: the number of the pin whose mode you wish to set
mode: either INPUT or OUTPUT</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:pointer?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:pointer</title>
        <link>https://wiki.nxez.com/en:arduino:language:pointer?rev=1482675302&amp;do=diff</link>
        <description>The pointer operators

&amp; (reference) and * (dereference)

Pointers are one of the more complicated subjects for beginners in learning C, and it is possible to write the vast majority of Arduino sketches without ever encountering pointers. However for manipulating certain data structures, the use of pointers can simplify the code, and and knowledge of manipulating pointers is handy to have in one's toolkit.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:pow?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:pow</title>
        <link>https://wiki.nxez.com/en:arduino:language:pow?rev=1482675302&amp;do=diff</link>
        <description>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 (float)
exponent: the power to which the base is raised (float)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:pulsein?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:pulsein</title>
        <link>https://wiki.nxez.com/en:arduino:language:pulsein?rev=1482675302&amp;do=diff</link>
        <description>pulseIn()

Description

Reads a pulse (either HIGH or LOW) on a pin. For example, if value is HIGH, pulseIn() waits for the pin to go HIGH, starts timing, then waits for the pin to go LOW and stops timing. Returns the length of the pulse in microseconds. Gives up and returns 0 if no pulse starts within a specified time out.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:random?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:random</title>
        <link>https://wiki.nxez.com/en:arduino:language:random?rev=1482675302&amp;do=diff</link>
        <description>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)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:randomseed?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:randomseed</title>
        <link>https://wiki.nxez.com/en:arduino:language:randomseed?rev=1482675302&amp;do=diff</link>
        <description>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 random number generator with a fairly random input, such as analogRead() on an unconnected pin.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:return?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:return</title>
        <link>https://wiki.nxez.com/en:arduino:language:return?rev=1482675302&amp;do=diff</link>
        <description>return

Terminate a function and return a value from a function to the calling function, if desired.

Syntax:

return;
return value; // both forms are valid

Parameters

value: any variable or constant type

Examples:

A function to compare a sensor input to a threshold</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:scope?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:scope</title>
        <link>https://wiki.nxez.com/en:arduino:language:scope?rev=1482675302&amp;do=diff</link>
        <description>Variable Scope

Variables in the C programming language, which Arduino uses, have a property called scope. This is in contrast to languages such as BASIC where every variable is a global variable.

A global variable is one that can be seen by every function in a program. Local variables are only visible to the function in which they are declared. In the Arduino environment, any variable declared outside of a function (e.g. setup(), loop(), etc. ), is a global variable.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:semicolon?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:semicolon</title>
        <link>https://wiki.nxez.com/en:arduino:language:semicolon?rev=1482675302&amp;do=diff</link>
        <description>; semicolon

Used to end a statement.

Example

int a = 13;

Tip

Forgetting to end a line in a semicolon will result in a compiler error. The error text may be obvious, and refer to a missing semicolon, or it may not. If an impenetrable or seemingly illogical compiler error comes up, one of the first things to check is a missing semicolon, in the immediate vicinity, preceding the line at which the compiler complained.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial?rev=1482675302&amp;do=diff</link>
        <description>Serial

Used for communication between the Arduino board and a computer or other devices. All Arduino boards have at least one serial port (also known as a UART or USART): Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB. Thus, if you use these functions, you cannot also use pins 0 and 1 for digital input or output.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_available?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_available</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_available?rev=1482675302&amp;do=diff</link>
        <description>Serial

available()

Description

Get the number of bytes (characters) available for reading from the serial port. This is data that's already arrived and stored in the serial receive buffer (which holds 64 bytes). available() inherits from the Stream utility class.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_begin?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_begin</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_begin?rev=1482675302&amp;do=diff</link>
        <description>Serial

begin()

Description

Sets the data rate in bits per second (baud) for serial data transmission. For communicating with the computer, use one of these rates: 300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200. You can, however, specify other rates - for example, to communicate over pins 0 and 1 with a component that requires a particular baud rate.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_end?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_end</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_end?rev=1482675302&amp;do=diff</link>
        <description>Serial

end()

Description

Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call Serial.begin().

Syntax

Serial.end()

Arduino Mega only: 

Serial1.end() 

Serial2.end()</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_find?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_find</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_find?rev=1482675302&amp;do=diff</link>
        <description>Serial.find()

Description

Serial.find() reads data from the serial buffer until the target string of given length is found. The function returns true if target string is found, false if it times out.

Serial.flush() inherits from the Stream utility class.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_finduntil?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_finduntil</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_finduntil?rev=1482675302&amp;do=diff</link>
        <description>Serial.findUntil()

Description

Serial.findUntil() reads data from the serial buffer until a target string of given length or terminator string is found.

The function returns true if the target string is found, false if it times out.

Serial.findUntil() inherits from the Stream utility class.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_flush?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_flush</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_flush?rev=1482675302&amp;do=diff</link>
        <description>Serial

flush()

Description

Waits for the transmission of outgoing serial data to complete. (Prior to Arduino 1.0, this instead removed any buffered incoming serial data.)
flush() inherits from the Stream utility class.

Syntax

Serial.flush()

Arduino Mega only:</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_ifserial?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_ifserial</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_ifserial?rev=1482675302&amp;do=diff</link>
        <description>Serial

if (Serial)

Description

Indicates if the specified Serial port is ready.

On the Leonardo, if (Serial) indicates wether or not the USB CDC serial connection is open. For all other instances, including if (Serial1) on the Leonardo, this will always returns true.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_parsefloat?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_parsefloat</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_parsefloat?rev=1482675302&amp;do=diff</link>
        <description>Serial.parseFloat()

Description

Serial.parseFloat() returns the first valid floating point number from the Serial buffer. Characters that are not digits (or the minus sign) are skipped. parseFloat() is terminated by the first character that is not a floating point number.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_parseint?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_parseint</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_parseint?rev=1482675302&amp;do=diff</link>
        <description>Serial

parseInt()

Description

Looks for the next valid integer in the incoming serial stream. parseInt() inherits from the Stream utility class.

Syntax

Serial.parseInt()

Arduino Mega only: 

Serial1.parseInt() 

Serial2.parseInt() 

Serial3.parseInt()</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_peek?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_peek</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_peek?rev=1482675302&amp;do=diff</link>
        <description>Serial

peek()

Description

Returns the next byte (character) of incoming serial data without removing it from the internal serial buffer. That is, successive calls to peek() will return the same character, as will the next call to read(). peek() inherits from the Stream utility class.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_print?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_print</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_print?rev=1482675302&amp;do=diff</link>
        <description>Serial

print()

Description

Prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers are printed using an ASCII character for each digit. Floats are similarly printed as ASCII digits, defaulting to two decimal places. Bytes are sent as a single character. Characters and strings are sent as is. For example:</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_println?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_println</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_println?rev=1482675302&amp;do=diff</link>
        <description>Serial

println()

Description

Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print().

Syntax</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_read?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_read</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_read?rev=1482675302&amp;do=diff</link>
        <description>Serial

read()

Description

Reads incoming serial data. read() inherits from the Stream utility class.

Syntax

Serial.read()

Arduino Mega only: 

Serial1.read() 

Serial2.read() 

Serial3.read()

Parameters

None

Returns

the first byte of incoming serial data available (or -1 if no data is available) - int</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_readbytes?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_readbytes</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_readbytes?rev=1482675302&amp;do=diff</link>
        <description>Serial.readBytes()

Description

Serial.readBytes() reads characters from the serial port into a buffer. The function terminates if the determined length has been read, or it times out (see Serial.setTimeout()).

Serial.readBytes() returns the number of characters placed in the buffer. A 0 means no valid data was found.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_readbytesuntil?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_readbytesuntil</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_readbytesuntil?rev=1482675302&amp;do=diff</link>
        <description>Serial.readBytesUntil()

Description

Serial.readBytesUntil() reads characters from the serial buffer into an array. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see Serial.setTimeout()).</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_settimeout?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_settimeout</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_settimeout?rev=1482675302&amp;do=diff</link>
        <description>Serial.setTimeout()

Description

Serial.setTimeout() sets the maximum milliseconds to wait for serial data when using Serial.readBytesUntil() or Serial.readBytes(). It defaults to 1000 milliseconds.

Serial.setTimeout() inherits from the Stream utility class.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:serial_write?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:serial_write</title>
        <link>https://wiki.nxez.com/en:arduino:language:serial_write?rev=1482675302&amp;do=diff</link>
        <description>Serial

write()

Description

Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead.

Syntax

Serial.write(val) 
Serial.write(str) 
Serial.write(buf, len)</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:setup?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:setup</title>
        <link>https://wiki.nxez.com/en:arduino:language:setup?rev=1482675302&amp;do=diff</link>
        <description>setup()

The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the Arduino board.

Example

 
int buttonPin = 3;

void setup()
{
  Serial.begin(9600);
  pinMode(buttonPin, INPUT);
}

void loop()
{
  // ...
}</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:shiftin?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:shiftin</title>
        <link>https://wiki.nxez.com/en:arduino:language:shiftin?rev=1482675302&amp;do=diff</link>
        <description>shiftIn()

Description

Shifts in a byte of data one bit at a time. Starts from either the most (i.e. the leftmost) or least (rightmost) significant bit. For each bit, the clock pin is pulled high, the next bit is read from the data line, and then the clock pin is taken low.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:shiftout?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:shiftout</title>
        <link>https://wiki.nxez.com/en:arduino:language:shiftout?rev=1482675302&amp;do=diff</link>
        <description>shiftOut()

Description

Shifts out a byte of data one bit at a time. Starts from either the most (i.e. the leftmost) or least (rightmost) significant bit. Each bit is written in turn to a data pin, after which a clock pin is pulsed (taken high, then low) to indicate that the bit is available.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:sin?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:sin</title>
        <link>https://wiki.nxez.com/en:arduino:language:sin?rev=1482675302&amp;do=diff</link>
        <description>sin(rad)

Description

Calculates the sine of an angle (in radians). The result will be between -1 and 1.

Parameters

rad: the angle in radians (float)

Returns

the sine of the angle (double)

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:sizeof?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:sizeof</title>
        <link>https://wiki.nxez.com/en:arduino:language:sizeof?rev=1482675302&amp;do=diff</link>
        <description>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 to be able to change the size of the array without breaking other parts of the program.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:sqrt?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:sqrt</title>
        <link>https://wiki.nxez.com/en:arduino:language:sqrt?rev=1482675302&amp;do=diff</link>
        <description>sqrt(x)

Description

Calculates the square root of a number.

Parameters

x: the number, any data type

Returns

double, the number's square root.

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:static?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:static</title>
        <link>https://wiki.nxez.com/en:arduino:language:static?rev=1482675302&amp;do=diff</link>
        <description>Static

The static keyword is used to create variables that are visible to only one function. However unlike local variables that get created and destroyed every time a function is called, static variables persist beyond the function call, preserving their data between function calls.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:string?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:string</title>
        <link>https://wiki.nxez.com/en:arduino:language:string?rev=1482675302&amp;do=diff</link>
        <description>string

Description

Text strings can be represented in two ways. you can use the String data type, which is part of the core as of version 0019, or you can make a string out of an array of type char and null-terminate it. This page described the latter method. For more details on the String object, which gives you more functionality at the cost of more memory, see the String object page.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:stringobject?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:stringobject</title>
        <link>https://wiki.nxez.com/en:arduino:language:stringobject?rev=1482675302&amp;do=diff</link>
        <description>String

Description

The String class, part of the core as of version 0019, allows you to use and manipulate strings of text in more complex ways than character arrays do. You can concatenate Strings, append to them, search for and replace substrings, and more. It takes more memory than a simple character array, but it is also more useful.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:switchcase?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:switchcase</title>
        <link>https://wiki.nxez.com/en:arduino:language:switchcase?rev=1482675302&amp;do=diff</link>
        <description>switch / case statements

Like if statements, switch...case controls the flow of programs by allowing programmers to specify different code that should be executed in various conditions. In particular, a switch statement compares the value of a variable to the values specified in case statements. When a case statement is found whose value matches that of the variable, the code in that case statement is run.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:tan?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:tan</title>
        <link>https://wiki.nxez.com/en:arduino:language:tan?rev=1482675302&amp;do=diff</link>
        <description>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 (float)

Returns

The tangent of the angle (double)

Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:tone?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:tone</title>
        <link>https://wiki.nxez.com/en:arduino:language:tone?rev=1482675302&amp;do=diff</link>
        <description>tone()

Description

Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to noTone(). The pin can be connected to a piezo buzzer or other speaker to play tones.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:unsignedchar?rev=1482675302&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:02+08:00</dc:date>
        <title>en:arduino:language:unsignedchar</title>
        <link>https://wiki.nxez.com/en:arduino:language:unsignedchar?rev=1482675302&amp;do=diff</link>
        <description>unsigned char

Description

An unsigned data type that occupies 1 byte of memory. Same as the byte datatype.
The unsigned char datatype encodes numbers from 0 to 255.
For consistency of Arduino programming style, the byte data type is to be preferred.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:unsignedint?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:unsignedint</title>
        <link>https://wiki.nxez.com/en:arduino:language:unsignedint?rev=1482675304&amp;do=diff</link>
        <description>unsigned int

Description

Unsigned ints (unsigned integers) are the same as ints in that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).

The difference between unsigned ints and (signed) ints, lies in the way the highest bit, sometimes refered to as the</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:unsignedlong?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:unsignedlong</title>
        <link>https://wiki.nxez.com/en:arduino:language:unsignedlong?rev=1482675304&amp;do=diff</link>
        <description>unsigned long

Description

Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs won't store negative numbers, making their range from 0 to 4,294,967,295 (2^32 - 1).</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:void?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:void</title>
        <link>https://wiki.nxez.com/en:arduino:language:void?rev=1482675304&amp;do=diff</link>
        <description>void

The void keyword is used only in function declarations. It indicates that the function is expected to return no information to the function from which it was called.

Example:


// actions are performed in the functions &quot;setup&quot; and &quot;loop&quot;
// but  no information is reported to the larger program

void setup()
{
  // ...
}

void loop()
{
  // ...
}</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:volatile?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:volatile</title>
        <link>https://wiki.nxez.com/en:arduino:language:volatile?rev=1482675304&amp;do=diff</link>
        <description>volatile keyword

volatile is a keyword known as a variable qualifier, it is usually used before the datatype of a variable, to modify the way in which the compiler and subsequent program treats the variable.

Declaring a variable volatile is a directive to the compiler. The compiler is software which translates your C/C++ code into the machine code, which are the real instructions for the Atmega chip in the Arduino.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:while?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:while</title>
        <link>https://wiki.nxez.com/en:arduino:language:while?rev=1482675304&amp;do=diff</link>
        <description>while loops

Description

while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:word?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:word</title>
        <link>https://wiki.nxez.com/en:arduino:language:word?rev=1482675304&amp;do=diff</link>
        <description>word

Description

A word stores a 16-bit unsigned number, from 0 to 65535. Same as an unsigned int.

Example


    word w = 10000; 


Reference Home</description>
    </item>
    <item rdf:about="https://wiki.nxez.com/en:arduino:language:wordcast?rev=1482675304&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-12-25T22:15:04+08:00</dc:date>
        <title>en:arduino:language:wordcast</title>
        <link>https://wiki.nxez.com/en:arduino:language:wordcast?rev=1482675304&amp;do=diff</link>
        <description>word()

Description

Convert a value to the word data type or create a word from two bytes.

Syntax


word(x) 
word(h, l)


Parameters


x: a value of any type
h: the high-order (leftmost) byte of the word
l: the low-order (rightmost) byte of the word</description>
    </item>
</rdf:RDF>
