<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.ocrobot.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.ocrobot.com/feed.php">
        <title> learing:examples</title>
        <description></description>
        <link>https://wiki.ocrobot.com/</link>
        <image rdf:resource="https://wiki.ocrobot.com/lib/tpl/20cones/images/favicon.ico" />
       <dc:date>2026-07-18T16:31:39+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:analoginoutserial&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:analoginput&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:analogreadserial&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:analogwritemega&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:array&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:asciitable&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:bareminimum&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:blink&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:blinkwithoutdelay&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:button&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:buttonstatechange&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:calibration&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:character_analysis&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:debounce&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:digitalreadserial&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:dimmer&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:fade&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:fading&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:forloop&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:graph&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:ifstatement&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:inputpullupserial&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:main&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:midi&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:physicalpixel&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:pitch_follower&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:readanalogvoltage&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:readasciistring&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:serialcallresponse&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:serialcallresponseascii&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:serialevent&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:simple_keyboard&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:smoothing&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:stringcharacters&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_addition_operator&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_append_operator&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_case_changes&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_characters&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_comparison_operators&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_constructors&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_index_of&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_length_string_length_trim&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_replace&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_start_with_ends_with&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_substring&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_to_int&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:switchcase&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:switchcase2&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:tone&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:tone4&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:virtualcolormixer&amp;rev=1760151335&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.ocrobot.com/doku.php?id=learing:examples:whileloop&amp;rev=1760151335&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.ocrobot.com/lib/tpl/20cones/images/favicon.ico">
        <title></title>
        <link>https://wiki.ocrobot.com/</link>
        <url>https://wiki.ocrobot.com/lib/tpl/20cones/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:analoginoutserial&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:analoginoutserial</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:analoginoutserial&amp;rev=1760151335&amp;do=diff</link>
        <description>Analog In, Out Serial（模拟输入输出）

这个例子展示了读取模拟脚输入，映射结果到0-255的范围，把读取结果以PWM输出来点亮LED。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 11 LED模块
	*  ALPHA 电位器模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展板1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:analoginput&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:analoginput</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:analoginput&amp;rev=1760151335&amp;do=diff</link>
        <description>Analog Input（模拟输入）

电位器是一个简单的，提供可变电阻带有旋钮的装置，可以作为控制器的模拟输入。这个例子中你要使用一个电位器来控制LED闪烁频率。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:analogreadserial&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:analogreadserial</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:analogreadserial&amp;rev=1760151335&amp;do=diff</link>
        <description>Analog Read Serial（读取模拟口输入）

这个例子用电位器演示怎样读取物理世界的模拟输入。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 电位器模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展版1号槽位。
	*  ALPHA 微动开关模块插入并行扩展板2号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:analogwritemega&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:analogwritemega</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:analogwritemega&amp;rev=1760151335&amp;do=diff</link>
        <description>OCROBOT MEGA2560上12颗LED的模拟输出

这个例子使用OCROBOT MEGA2560使12颗LED依次产生渐变效果。

MEGA2560

硬件要求

	*  OCROBOT MEGA2560控制器
	*  12个LED
	*  1个220欧姆电阻
	*  连接线
	*  面包板
	*  导线

在LED长脚的一端串联一个220欧姆限流电阻到控制器数字口2-13，短的脚接地。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:array&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:array</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:array&amp;rev=1760151335&amp;do=diff</link>
        <description>Arrays（数组）

这些loop循环中的变量演示了数组的用法。数组是有多部分构成的变量。如果把变量看作是存储数值的杯子的话，数组就是托盘。就像一系列连起来的杯子一样，所有的杯子都能存储同样的最大值。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:asciitable&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:asciitable</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:asciitable&amp;rev=1760151335&amp;do=diff</link>
        <description>ASCII Table （ASCII码表）

通过制作字符表和对应的ASCII值对应的的二进制，八进制，十进制，十六进制值演示了高级的串口打印功能。更多关于ASCII的信息请看asciitable.com 

ALPHA MEGA328-U核心

硬件</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:bareminimum&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:bareminimum</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:bareminimum&amp;rev=1760151335&amp;do=diff</link>
        <description>BareMinimum（基础代码）

这个例程介绍程序的最基础的代码:setup()和loop()

代码


void setup(){
  // 初始化代码放这里，这里的代码只会运行一次。
}
void loop(){
  // 核心代码放这里，这里的代码会不停的循环运行。
}</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:blink&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:blink</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:blink&amp;rev=1760151335&amp;do=diff</link>
        <description>Blink（单LED闪烁）

这个例程显示了你可以用OCROBOT各款控制器做到的最简单的事，单LED闪烁（Blink）。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 11 LED模块

搭建电路

	*  ALPHA 11 LED模块插入并行扩展版1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:blinkwithoutdelay&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:blinkwithoutdelay</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:blinkwithoutdelay&amp;rev=1760151335&amp;do=diff</link>
        <description>Blink Without Delay（不使用delay来使LED闪烁）

有时候你需要同时做两件事，比如读取按键信息的同时想点亮熄灭一个LED，在这种情况下，你可能不会想去用delay()函数，因为使用delay()的时候会中断你的控制器其他工作。如果控制器执行delay的时候你按下了按键，这样就会错过按键按下的信息。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:button&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:button</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:button&amp;rev=1760151335&amp;do=diff</link>
        <description>Button（按键）

当你按下按键的时候会接通电路的两点。这个例子是当你按下按键的时候点亮连接在12号脚上的LED。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 微动开关模块
	*  ALPHA 11 LED模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展版1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:buttonstatechange&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:buttonstatechange</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:buttonstatechange&amp;rev=1760151335&amp;do=diff</link>
        <description>Button State Change Detection (监测按键状态改变)

如果你的按键工作后，通常你会需要基于按键按下多少次来做出反应。为了达到这个目的，你需要知道什么时候按键被打开或者关闭了，并且知道按键被按下的次数，这就是状态监测。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:calibration&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:calibration</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:calibration&amp;rev=1760151335&amp;do=diff</link>
        <description>Calibration（校准）

这个例子展示了校准传感器输入的方法。控制器在程序开始后的前五秒读取传感器数据，记录读取到的最大最小值。这些前五秒读取到的数据定义了读取数据的最大最小期望值。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:character_analysis&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:character_analysis</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:character_analysis&amp;rev=1760151335&amp;do=diff</link>
        <description>String Character Analysis（字符串的字符解析）

这个例子中我们使用运算符来分辨字符类型。这对于检查字符是否是ASCII或者大写字母或是数字或者标点符号等很有用。可供选择的项覆盖了多种情景，下面的程序中进行演示。每一个通过IDE串口发送到控制器的字符都被程序解析，返回所有可能获取到的信息。单个字符可能触发几种情况，所以你可能从一个输入中得到多个答案。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:debounce&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:debounce</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:debounce&amp;rev=1760151335&amp;do=diff</link>
        <description>Debounce（消抖）

这个例子演示了如何消除输入抖动，也就是在一段时间内检查两次来确保按键被按下。如果不消抖，按键一次会被代码识别为多次按下。利用millis()功能来记录按键按下后的时间。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:digitalreadserial&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:digitalreadserial</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:digitalreadserial&amp;rev=1760151335&amp;do=diff</link>
        <description>Digital Read Serial（读取数字口开关状态）

这个例子教你怎样用控制器的USB端口，通过串口通讯监视开关状态。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 微动开关模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展版1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:dimmer&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:dimmer</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:dimmer&amp;rev=1760151335&amp;do=diff</link>
        <description>Dimmer(熄灭LED)

这个例子演示了从电脑发送数据到控制器来控制LED的亮度。数据是按每个字节发送的，范围在0-255。OCROBOT控制器读取这些数据，用它们设置LED亮度。

你可以使用任意的可以使用电脑串口的软件来发送数据。下面的程序是用processing演示的。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:fade&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:fade</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:fade&amp;rev=1760151335&amp;do=diff</link>
        <description>Fading（明暗）

使用analogWrite()功能让LED渐变亮或者渐变灭。analogWrite使用了PWM（脉冲宽度调制）功能,快速打开或者关闭数字引脚来制造渐变的效果。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 11 LED模块

搭建电路</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:fading&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:fading</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:fading&amp;rev=1760151335&amp;do=diff</link>
        <description>Fading（变色）

使用模拟输出（PWM）使LED变色。PWM是一种使用快速开关数字输出口来控制模拟电路的方法。

ALPHA 8F328D-U核心

硬件

搭建电路

代码

MangoII

电路

串联一个220欧姆电阻和LED到数字口9</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:forloop&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:forloop</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:forloop&amp;rev=1760151335&amp;do=diff</link>
        <description>For Loop Iteration (aka The Knight Rider)（循环）

你经常会遇到要遍历一系列引脚并且使用每一个引脚。例如，这个例子通过使用for()循环来使连接在arduino上的2-7号数字引脚的6个LED闪烁， 使用digitalWrite() 和delay() 使这些LED连续的亮灭。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:graph&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:graph</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:graph&amp;rev=1760151335&amp;do=diff</link>
        <description>Graph（成图）

这个例子使用控制器发送ADC采集后的电位器数据到电脑上，Processing使用这些数据进行绘图。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 电位器模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展版1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:ifstatement&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:ifstatement</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:ifstatement&amp;rev=1760151335&amp;do=diff</link>
        <description>If Statement (Conditional Statement)（条件声明）

if()声明是所有编程控制结构里最基础的。它允许你基于给定的条件的真或假来决定某事的发生或者不发生。比如

if (someCondition) {
   // do stuff if the condition is true
}</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:inputpullupserial&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:inputpullupserial</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:inputpullupserial&amp;rev=1760151335&amp;do=diff</link>
        <description>Input Pullup Serial （读取输入口，启用上拉电阻）

这个例子演示了pinmode()的INPUT_PULLUP参数。它通过OCROBOT控制器与电脑的USB串口通讯来检测开关的状态。

除此之外，当输入HIGH，板上13号脚连接的LED点亮，否则熄灭。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:main&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:main</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:main&amp;rev=1760151335&amp;do=diff</link>
        <description>例程

下面的例子是一些核心功能和扩展库的概述。

核心功能

使用核心功能，需要懂基本语法来进行一些简单的编程。

以下例程，在IDE的“文件”---“示例“菜单中可以直接打开。

1.基础</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:midi&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:midi</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:midi&amp;rev=1760151335&amp;do=diff</link>
        <description>MIDI Note Player（MIDI音乐播放器）

这个教程演示了使用标准5口的DIN线从OCROBOT控制器发送MIDI音符到MIDI乐器。

MIDI是乐器数字接口，是合成器、音序器和别的乐器的有效的协议标准。MIDI设备一般由两大类组成：控制器（也就是基于人的动作产生MIDI信号的设备）和合成器（包括采样器，音序器等等）。后者接收MIDI信数据并且发声，发光或者其它的效果。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:physicalpixel&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:physicalpixel</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:physicalpixel&amp;rev=1760151335&amp;do=diff</link>
        <description>物理像素

这个例子演示了使用arduino接收来自电脑的数据。收到 H 字符的时候点亮LED，收到  L    的时候熄灭。

数据使用arduino自带的串口监视器发送，也可以使用processing（代码在下面）。

ALPHA 8F328D-U核心</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:pitch_follower&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:pitch_follower</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:pitch_follower&amp;rev=1760151335&amp;do=diff</link>
        <description>Pitch follower using the tone() function （使用tone功能随输入量改变音高）

此例程演示了使用tone功能来产生一个随输入值变化的音高。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 电位器模块
	*  ALPHA 蜂鸣器模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展板1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:readanalogvoltage&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:readanalogvoltage</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:readanalogvoltage&amp;rev=1760151335&amp;do=diff</link>
        <description>ReadAnalogVoltage (读取模拟口电压)

这个例子会告诉你如何读取A0号脚上的模拟输入信号，并将信号转换为电压值显示到串口监视器上。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 电位器模块

搭建电路

	*  ALPHA MEGA328-U模块插入并行扩展版1号槽位。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:readasciistring&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:readasciistring</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:readasciistring&amp;rev=1760151335&amp;do=diff</link>
        <description>Read ASCII String （读取ASCII字符串）

这个例子使用 Serial.parseInt()功能来找到被非字母数字字符分隔的值。通常人们使用一个逗号来区分几条不同的信息（这个格式通常简称逗号分隔值），但是别的字符例如空格或者句号也可以。这个值被解析后作为输入使LED变色。你将使用串口监视器来发送字符串如</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:serialcallresponse&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:serialcallresponse</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:serialcallresponse&amp;rev=1760151335&amp;do=diff</link>
        <description>Serial Call and Response (handshaking)（串口应答，握手）

这个例子演示了使用握手方法从arduino到电脑的多个字符的传输

程序重复发送ASCII的A，得到电脑串口的回应之后，以单字节发送三个传感器的值，等待电脑回应</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:serialcallresponseascii&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:serialcallresponseascii</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:serialcallresponseascii&amp;rev=1760151335&amp;do=diff</link>
        <description>Serial Call and Response (handshaking) with ASCII-encoded output

This example demonstrates string-based communication from the Arduino or Genuino board to the computer using a call-and-response (handshaking) method.

The sketch sends an ASCII string on startup and repeats that until it gets a serial response from the computer. Then it sends three sensor values as</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:serialevent&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:serialevent</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:serialevent&amp;rev=1760151335&amp;do=diff</link>
        <description>SerialEvent（串口事件）

这个例子演示了SerialEvent()功能。这个功能在loop里调用。串口缓冲区有数据的时候，就把取到的字符加到字符串，直到接收到换行符。由字符组成的字符串显示到串口监视器上，并清空。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:simple_keyboard&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:simple_keyboard</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:simple_keyboard&amp;rev=1760151335&amp;do=diff</link>
        <description>Simple keyboard using the tone() function（简易键盘）

此例程显示了使用tone命令基于按下不同的传感器来产生不同的音高。

ALPHA 8F328D-U核心

硬件

搭建电路

代码

MangoII

硬件要求
8欧姆阻抗扬声器</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:smoothing&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:smoothing</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:smoothing&amp;rev=1760151335&amp;do=diff</link>
        <description>Smoothing（平滑处理）

这个例子演示了不断读取模拟输入的数据，计算连续数据的平均值并且显示到电脑上。这个例子对于平滑不规则的跳跃性的输出值很有用，同样也演示了数组的用法。

ALPHA MEGA328-U核心</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:stringcharacters&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:stringcharacters</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:stringcharacters&amp;rev=1760151335&amp;do=diff</link>
        <description>String Character Analysis

In this example we use the operators that allow us to recognise the type of character we are dealing with. It is useful to check if a character is ASCII, or is upper case, or numeric, or it is a punctuation mark and so forth. The options available cover a variety of situations and this is demonstrated in the sketch below. Every character sent to the board through the serial monitor of the Arduino Software (IDE) is analysed by the sketch that returns all the information…</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_addition_operator&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_addition_operator</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_addition_operator&amp;rev=1760151335&amp;do=diff</link>
        <description>String Addition Operator （字符串加法运算）

你可以使用不同的方法将几个字符串合并为一个。这就是合并，合并使原始字符串加长了，加上合并的字符的长度。“+“操作可以把一个字符串和别的字符串相结合，通过常量的字符数组，ASCII表示的常量或者变量，或者常量字符。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_append_operator&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_append_operator</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_append_operator&amp;rev=1760151335&amp;do=diff</link>
        <description>String Appending Operators(字符串附加运算)

你可以使用StringAdditionOperator来合并不同的数据类型到字符串，当然也可以使用+=运算符和concat()方法来添加别的东西到字符串。+=运算符和concat()方法的工作原理是一样的，用哪种方法全凭喜好。下面的两个例子说明了这两种方法的使用，并且得到相同的字符串。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_case_changes&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_case_changes</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_case_changes&amp;rev=1760151335&amp;do=diff</link>
        <description>String Case Change Functions(字符串大小写切换)

字符大小写切换功能允许你改变一个字符为大写或者小写。就像它们的名字表示的那样。toUpperCase()把整个字符串改变为大写字符，toLowerCase()改为小写字符。只有对A-Z的字符和a-z的字符有效。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_characters&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_characters</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_characters&amp;rev=1760151335&amp;do=diff</link>
        <description>String Character Functions

charAt()和setCharAt()是用来得到或者设置一个字符串里的给定的位置的字符的值。

这些功能帮你寻找替换指定的字符。例如，下面就是在一个给定的字符串中替换冒号为等号。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_comparison_operators&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_comparison_operators</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_comparison_operators&amp;rev=1760151335&amp;do=diff</link>
        <description>String Comparison Operators （字符比较）

字符比较运算符 ==, !=,&gt;, &lt; ,&gt;=, &lt;=  和 equals() equalsIgnoreCase()使你可以在字符串里比较字母。
 == 和equals() 是等价的，也就是说

if (stringOne.equals(stringTwo)) {

等同于</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_constructors&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_constructors</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_constructors&amp;rev=1760151335&amp;do=diff</link>
        <description>String Object Constructors（字符串构造）

字符串的操作允许你以多种方法操作字符串。可以把字符加进字符串，可以合并字符串，可以得到字符串的长度，替换字符等。这个例子教你如何初始化字符串对象</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_index_of&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_index_of</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_index_of&amp;rev=1760151335&amp;do=diff</link>
        <description>String indexOf() and lastIndexOf() Method (查找字符串)

indexOf()可以在字符串里寻找特定字符值的第一个实例。也可以在一个给定的起始端寻找字符。lastIndexOf()同样的是在字符串末尾寻找。


  String stringOne = &quot;&lt;HTML&gt;&lt;HEAD&gt;&lt;BODY&gt;&quot;;
  int firstClosingBracket = stringOne.indexOf('&gt;');</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_length_string_length_trim&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_length_string_length_trim</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_length_string_length_trim&amp;rev=1760151335&amp;do=diff</link>
        <description>String length() and trim() Commands（字符串长度）

你可以使用length()得到一个字符串的长度，或者使用trim() 除去额外的字符。这个例子演示了它们的用法。

硬件要求
OCROBOT控制器USB线
这个例子没有电路图，只需要通过USB线把你的OCROBOT控制器连上电脑，并且打开串口监视器。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_replace&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_replace</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_replace&amp;rev=1760151335&amp;do=diff</link>
        <description>String replace Function（字符替换）

 replace()可以替换所有的字符为另一个字符。也可以替换子字符串。

硬件要求
OCROBOT控制器USB线
这个例子没有电路图，只需要通过USB线把你的OCROBOT控制器连上电脑，并且打开串口监视器。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_start_with_ends_with&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_start_with_ends_with</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_start_with_ends_with&amp;rev=1760151335&amp;do=diff</link>
        <description>String startsWith and endsWith Functions（起始符结束符）

 startsWith() 和endsWith()可以检查指定的字符串的开头和结尾的字符是什么。这也是基础的子字符串。

硬件要求
OCROBOT控制器USB线
这个例子没有电路图，只需要通过USB线把你的OCROBOT控制器连上电脑，并且打开串口监视器。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_substring&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_substring</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_substring&amp;rev=1760151335&amp;do=diff</link>
        <description>String substring Function（截取字符串）

 substring()和 charAt()类似，允许你在给定的字符串里寻找一个特别的子字符串。

硬件要求
OCROBOT控制器USB线
这个例子没有电路图，只需要通过USB线把你的OCROBOT控制器连上电脑，并且打开串口监视器。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:string_to_int&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:string_to_int</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:string_to_int&amp;rev=1760151335&amp;do=diff</link>
        <description>String to Int Function （转换为整型）

toInt() 功能可以转换字符串为整型数字

这个例子，控制器读取串口输入的字符串直到出现换行符，如果字符是数字的话转换字符串为数字。下载好程序之后打开串口监视器，输入几个数字，按发送，控制器会一直返回这些数字给你，观察当非数字字符被发送之后看会发生什么现象。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:switchcase&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:switchcase</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:switchcase&amp;rev=1760151335&amp;do=diff</link>
        <description>Switch (case) Statement, used with sensor input

An if statement allows you to choose between two discrete options, TRUE or FALSE. When there are more than two options, you can use multiple if statements, or you can use the switch statement. Switch allows you to choose between several discrete options. This tutorial shows you how to use it to switch between four desired states of a photo resistor: really dark, dim, medium, and bright.</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:switchcase2&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:switchcase2</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:switchcase2&amp;rev=1760151335&amp;do=diff</link>
        <description>Switch (case) Statement, used with serial input（串口输入）

if声明使你可以在两个不相关的事情上做出选择，真或假。当有更多选择的时候，你可以使用复杂的if声明，或者使用switch声明。switch允许你在多个不相关事情上做出选择。</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:tone&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:tone</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:tone&amp;rev=1760151335&amp;do=diff</link>
        <description>Play a Melody using the tone() function（使用tone功能播放乐曲）

这个例子演示了怎样使用tone命令来产生音符。播放一小段你之前可能听过的乐曲。

ALPHA MEGA328-U核心

硬件

	*  ALPHA 并行扩展板
	*  ALPHA MEGA328-U
	*  ALPHA 蜂鸣器模块

搭建电路

	*</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:tone4&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:tone4</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:tone4&amp;rev=1760151335&amp;do=diff</link>
        <description>SPlaying tones on Multiple outputs using the tone() function （使用tone功能在多个输出引脚播放音乐）

这个例子显示了在多路输出使用tone功能播放不同音乐

tong命令使用ATMEGA芯片内部的计时器来工作，设置一个你想需要的频率，使用计时器产生脉冲到输出引脚。因为只用到一个计时器，所以一次只能播放一种音乐，然而你需要在多个引脚连续播放音乐，想要达到这种目的，你需要在把计时器转到下一个引脚的时候关闭上一个引脚的计时器。…</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:virtualcolormixer&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:virtualcolormixer</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:virtualcolormixer&amp;rev=1760151335&amp;do=diff</link>
        <description>Virtual Color Mixer

This example demonstrates how to send multiple values from the Arduino board to the computer. The readings from three potentiometers are used to set the red, green, and blue components of the background color of a Processing sketch or Max/MSP patch.</description>
    </item>
    <item rdf:about="https://wiki.ocrobot.com/doku.php?id=learing:examples:whileloop&amp;rev=1760151335&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T02:55:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>learing:examples:whileloop</title>
        <link>https://wiki.ocrobot.com/doku.php?id=learing:examples:whileloop&amp;rev=1760151335&amp;do=diff</link>
        <description>While Loop （while循环）

有时候你会想暂停所有的程序当一个给定的条件是真的话。这种情况下你可以使用while循环，这个例子会演示使用while循环校准模拟输入值。

主循环中，程序读取连接在A0口的电位器的值，并用它熄灭链接在9号引脚的led灯。当2号引脚的按键被按下后，程序寻找传感器的最大最小值进行校准，按键松开后，继续循环。</description>
    </item>
</rdf:RDF>
