Index: rtos_arduino/trunk/examples/PIXY_Zumo/Makefile
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/Makefile	(revision 236)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg 
+APPL_CFG      = r2ca_app.cfg 
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -56,5 +56,5 @@
 #  Zumo Library
 # 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ZumoShield
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ZumoShield
 APPL_CXXOBJS += Accelerometer.o L3G.o LSM303.o Pushbutton.o QTRSensors.o ZumoBuzzer.o ZumoMotors.o
 APPL_CFG     += ZumoShield.cfg
@@ -63,5 +63,5 @@
 #  Pixy Library
 #
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Pixy
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Pixy
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,169 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents />
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.222</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.cproj	(revision 260)
@@ -0,0 +1,168 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,9 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
+INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,249 @@
+#include "r2ca.h"
+#include <Wire.h>
+#include <ZumoShield.h>
+
+#include <SPI.h>  
+#include <Pixy.h>
+
+//==========================================================================
+//
+//  Pixy Pet Robot
+//
+//   Adafruit invests time and resources providing this open source code, 
+//  please support Adafruit and open-source hardware by purchasing 
+//  products from Adafruit!
+//
+// Written by: Bill Earl for Adafruit Industries
+//
+//==========================================================================
+// begin license header
+//
+// All Pixy Pet source code is provided under the terms of the
+// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
+//
+// end license header
+//
+//==========================================================================
+//
+// Portions of this code are derived from the Pixy CMUcam5 pantilt example code. 
+//
+//==========================================================================
+ 
+#define X_CENTER    160L
+#define Y_CENTER    100L
+#define RCS_MIN_POS     0L
+#define RCS_MAX_POS     1000L
+#define RCS_CENTER_POS	((RCS_MAX_POS-RCS_MIN_POS)/2)
+ 
+//---------------------------------------
+// Servo Loop Class
+// A Proportional/Derivative feedback
+// loop for pan/tilt servo tracking of
+// blocks.
+// (Based on Pixy CMUcam5 example code)
+//---------------------------------------
+class ServoLoop
+{
+public:
+	ServoLoop(int32_t proportionalGain, int32_t derivativeGain);
+ 
+	void update(int32_t error);
+ 
+	int32_t m_pos;
+	int32_t m_prevError;
+	int32_t m_proportionalGain;
+	int32_t m_derivativeGain;
+};
+ 
+// ServoLoop Constructor
+ServoLoop::ServoLoop(int32_t proportionalGain, int32_t derivativeGain)
+{
+	m_pos = RCS_CENTER_POS;
+	m_proportionalGain = proportionalGain;
+	m_derivativeGain = derivativeGain;
+	m_prevError = 0x80000000L;
+}
+ 
+// ServoLoop Update 
+// Calculates new output based on the measured
+// error and the current state.
+void ServoLoop::update(int32_t error)
+{
+	long int velocity;
+	char buf[32];
+	if (m_prevError!=0x80000000)
+	{	
+		velocity = (error*m_proportionalGain + (error - m_prevError)*m_derivativeGain)>>10;
+ 
+		m_pos += velocity;
+		if (m_pos>RCS_MAX_POS) 
+		{
+			m_pos = RCS_MAX_POS; 
+		}
+		else if (m_pos<RCS_MIN_POS) 
+		{
+			m_pos = RCS_MIN_POS;
+		}
+	}
+	m_prevError = error;
+}
+// End Servo Loop Class
+//---------------------------------------
+ 
+Pixy pixy;  // Declare the camera object
+ 
+ServoLoop panLoop(200, 200);  // Servo loop for pan
+ServoLoop tiltLoop(150, 200); // Servo loop for tilt
+ 
+void ScanForBlocks();
+void FollowBlock(int trackedBlock);
+int TrackBlock(int blockCount);
+
+//---------------------------------------
+// Setup - runs once at startup
+//---------------------------------------
+void setup()
+{
+	ZumoInit();
+	buzzer.playOn();    
+	Serial.begin(115200);
+	Serial.print("Starting...\n");
+	pixy.init();
+
+    button.waitForPress();
+    buzzer.playStart();    
+}
+ 
+uint32_t lastBlockTime = 0;
+ 
+//---------------------------------------
+// Main loop - runs continuously after setup
+//---------------------------------------
+void loop()
+{ 
+	uint16_t blocks;
+	blocks = pixy.getBlocks();
+ 
+	// If we have blocks in sight, track and follow them
+	if (blocks)
+	{
+		int trackedBlock = TrackBlock(blocks);
+		FollowBlock(trackedBlock);
+		lastBlockTime = millis();
+	}  
+	else if (millis() - lastBlockTime > 100)
+	{
+		motors.setLeftSpeed(0);
+		motors.setRightSpeed(0);
+		ScanForBlocks();
+	}
+}
+ 
+int oldX, oldY, oldSignature;
+ 
+//---------------------------------------
+// Track blocks via the Pixy pan/tilt mech
+// (based in part on Pixy CMUcam5 pantilt example)
+//---------------------------------------
+int TrackBlock(int blockCount)
+{
+	int trackedBlock = 0;
+	long maxSize = 0;
+ 
+	Serial.print("blocks =");
+	Serial.println(blockCount);
+ 
+	for (int i = 0; i < blockCount; i++)
+	{
+		if ((oldSignature == 0) || (pixy.blocks[i].signature == oldSignature))
+		{
+			long newSize = pixy.blocks[i].height * pixy.blocks[i].width;
+			if (newSize > maxSize)
+			{
+				trackedBlock = i;
+				maxSize = newSize;
+			}
+		}
+	}
+ 
+	int32_t panError = X_CENTER - pixy.blocks[trackedBlock].x;
+	int32_t tiltError = pixy.blocks[trackedBlock].y - Y_CENTER;
+ 
+	panLoop.update(panError);
+	tiltLoop.update(tiltError);
+ 
+	pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+ 
+	oldX = pixy.blocks[trackedBlock].x;
+	oldY = pixy.blocks[trackedBlock].y;
+	oldSignature = pixy.blocks[trackedBlock].signature;
+	return trackedBlock;
+}
+ 
+//---------------------------------------
+// Follow blocks via the Zumo robot drive
+//
+// This code makes the robot base turn 
+// and move to follow the pan/tilt tracking
+// of the head.
+//---------------------------------------
+int32_t size = 400;
+void FollowBlock(int trackedBlock)
+{
+	int32_t followError = RCS_CENTER_POS - panLoop.m_pos;  // How far off-center are we looking now?
+ 
+	// Size is the area of the object.
+	// We keep a running average of the last 8.
+	size += pixy.blocks[trackedBlock].width * pixy.blocks[trackedBlock].height; 
+	size -= size >> 3;
+ 
+	// Forward speed decreases as we approach the object (size is larger)
+	int forwardSpeed = constrain(400 - (size/256), -100, 400);  
+ 
+	// Steering differential is proportional to the error times the forward speed
+	int32_t differential = (followError + (followError * forwardSpeed))>>8;
+ 
+	// Adjust the left and right speeds by the steering differential.
+	int leftSpeed = constrain(forwardSpeed + differential, -400, 400);
+	int rightSpeed = constrain(forwardSpeed - differential, -400, 400);
+ 
+	// And set the motor speeds
+	motors.setLeftSpeed(leftSpeed);
+	motors.setRightSpeed(rightSpeed);
+}
+ 
+//---------------------------------------
+// Random search for blocks
+//
+// This code pans back and forth at random
+// until a block is detected
+//---------------------------------------
+int scanIncrement = (RCS_MAX_POS - RCS_MIN_POS) / 150;
+uint32_t lastMove = 0;
+ 
+void ScanForBlocks()
+{
+	if (millis() - lastMove > 20)
+	{
+		lastMove = millis();
+		panLoop.m_pos += scanIncrement;
+		if ((panLoop.m_pos >= RCS_MAX_POS)||(panLoop.m_pos <= RCS_MIN_POS))
+		{
+			tiltLoop.m_pos = random(RCS_MAX_POS * 0.6, RCS_MAX_POS);
+			scanIncrement = -scanIncrement;
+			if (scanIncrement < 0)
+			{
+				motors.setLeftSpeed(-250);
+				motors.setRightSpeed(250);
+			}
+			else
+			{
+				motors.setLeftSpeed(+180);
+				motors.setRightSpeed(-180);
+			}
+			delay(random(250, 500));
+		}
+ 
+		pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+	}
+}
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca.atsln	(revision 236)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca.componentinfo.xml	(revision 236)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca.cproj	(revision 236)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cfg	(revision 236)
+++ 	(revision )
@@ -1,9 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
-INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cpp	(revision 236)
+++ 	(revision )
@@ -1,249 +1,0 @@
-#include "rca.h"
-#include <Wire.h>
-#include <ZumoShield.h>
-
-#include <SPI.h>  
-#include <Pixy.h>
-
-//==========================================================================
-//
-//  Pixy Pet Robot
-//
-//   Adafruit invests time and resources providing this open source code, 
-//  please support Adafruit and open-source hardware by purchasing 
-//  products from Adafruit!
-//
-// Written by: Bill Earl for Adafruit Industries
-//
-//==========================================================================
-// begin license header
-//
-// All Pixy Pet source code is provided under the terms of the
-// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
-//
-// end license header
-//
-//==========================================================================
-//
-// Portions of this code are derived from the Pixy CMUcam5 pantilt example code. 
-//
-//==========================================================================
- 
-#define X_CENTER    160L
-#define Y_CENTER    100L
-#define RCS_MIN_POS     0L
-#define RCS_MAX_POS     1000L
-#define RCS_CENTER_POS	((RCS_MAX_POS-RCS_MIN_POS)/2)
- 
-//---------------------------------------
-// Servo Loop Class
-// A Proportional/Derivative feedback
-// loop for pan/tilt servo tracking of
-// blocks.
-// (Based on Pixy CMUcam5 example code)
-//---------------------------------------
-class ServoLoop
-{
-public:
-	ServoLoop(int32_t proportionalGain, int32_t derivativeGain);
- 
-	void update(int32_t error);
- 
-	int32_t m_pos;
-	int32_t m_prevError;
-	int32_t m_proportionalGain;
-	int32_t m_derivativeGain;
-};
- 
-// ServoLoop Constructor
-ServoLoop::ServoLoop(int32_t proportionalGain, int32_t derivativeGain)
-{
-	m_pos = RCS_CENTER_POS;
-	m_proportionalGain = proportionalGain;
-	m_derivativeGain = derivativeGain;
-	m_prevError = 0x80000000L;
-}
- 
-// ServoLoop Update 
-// Calculates new output based on the measured
-// error and the current state.
-void ServoLoop::update(int32_t error)
-{
-	long int velocity;
-	char buf[32];
-	if (m_prevError!=0x80000000)
-	{	
-		velocity = (error*m_proportionalGain + (error - m_prevError)*m_derivativeGain)>>10;
- 
-		m_pos += velocity;
-		if (m_pos>RCS_MAX_POS) 
-		{
-			m_pos = RCS_MAX_POS; 
-		}
-		else if (m_pos<RCS_MIN_POS) 
-		{
-			m_pos = RCS_MIN_POS;
-		}
-	}
-	m_prevError = error;
-}
-// End Servo Loop Class
-//---------------------------------------
- 
-Pixy pixy;  // Declare the camera object
- 
-ServoLoop panLoop(200, 200);  // Servo loop for pan
-ServoLoop tiltLoop(150, 200); // Servo loop for tilt
- 
-void ScanForBlocks();
-void FollowBlock(int trackedBlock);
-int TrackBlock(int blockCount);
-
-//---------------------------------------
-// Setup - runs once at startup
-//---------------------------------------
-void setup()
-{
-	ZumoInit();
-	buzzer.playOn();    
-	Serial.begin(115200);
-	Serial.print("Starting...\n");
-	pixy.init();
-
-    button.waitForPress();
-    buzzer.playStart();    
-}
- 
-uint32_t lastBlockTime = 0;
- 
-//---------------------------------------
-// Main loop - runs continuously after setup
-//---------------------------------------
-void loop()
-{ 
-	uint16_t blocks;
-	blocks = pixy.getBlocks();
- 
-	// If we have blocks in sight, track and follow them
-	if (blocks)
-	{
-		int trackedBlock = TrackBlock(blocks);
-		FollowBlock(trackedBlock);
-		lastBlockTime = millis();
-	}  
-	else if (millis() - lastBlockTime > 100)
-	{
-		motors.setLeftSpeed(0);
-		motors.setRightSpeed(0);
-		ScanForBlocks();
-	}
-}
- 
-int oldX, oldY, oldSignature;
- 
-//---------------------------------------
-// Track blocks via the Pixy pan/tilt mech
-// (based in part on Pixy CMUcam5 pantilt example)
-//---------------------------------------
-int TrackBlock(int blockCount)
-{
-	int trackedBlock = 0;
-	long maxSize = 0;
- 
-	Serial.print("blocks =");
-	Serial.println(blockCount);
- 
-	for (int i = 0; i < blockCount; i++)
-	{
-		if ((oldSignature == 0) || (pixy.blocks[i].signature == oldSignature))
-		{
-			long newSize = pixy.blocks[i].height * pixy.blocks[i].width;
-			if (newSize > maxSize)
-			{
-				trackedBlock = i;
-				maxSize = newSize;
-			}
-		}
-	}
- 
-	int32_t panError = X_CENTER - pixy.blocks[trackedBlock].x;
-	int32_t tiltError = pixy.blocks[trackedBlock].y - Y_CENTER;
- 
-	panLoop.update(panError);
-	tiltLoop.update(tiltError);
- 
-	pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
- 
-	oldX = pixy.blocks[trackedBlock].x;
-	oldY = pixy.blocks[trackedBlock].y;
-	oldSignature = pixy.blocks[trackedBlock].signature;
-	return trackedBlock;
-}
- 
-//---------------------------------------
-// Follow blocks via the Zumo robot drive
-//
-// This code makes the robot base turn 
-// and move to follow the pan/tilt tracking
-// of the head.
-//---------------------------------------
-int32_t size = 400;
-void FollowBlock(int trackedBlock)
-{
-	int32_t followError = RCS_CENTER_POS - panLoop.m_pos;  // How far off-center are we looking now?
- 
-	// Size is the area of the object.
-	// We keep a running average of the last 8.
-	size += pixy.blocks[trackedBlock].width * pixy.blocks[trackedBlock].height; 
-	size -= size >> 3;
- 
-	// Forward speed decreases as we approach the object (size is larger)
-	int forwardSpeed = constrain(400 - (size/256), -100, 400);  
- 
-	// Steering differential is proportional to the error times the forward speed
-	int32_t differential = (followError + (followError * forwardSpeed))>>8;
- 
-	// Adjust the left and right speeds by the steering differential.
-	int leftSpeed = constrain(forwardSpeed + differential, -400, 400);
-	int rightSpeed = constrain(forwardSpeed - differential, -400, 400);
- 
-	// And set the motor speeds
-	motors.setLeftSpeed(leftSpeed);
-	motors.setRightSpeed(rightSpeed);
-}
- 
-//---------------------------------------
-// Random search for blocks
-//
-// This code pans back and forth at random
-// until a block is detected
-//---------------------------------------
-int scanIncrement = (RCS_MAX_POS - RCS_MIN_POS) / 150;
-uint32_t lastMove = 0;
- 
-void ScanForBlocks()
-{
-	if (millis() - lastMove > 20)
-	{
-		lastMove = millis();
-		panLoop.m_pos += scanIncrement;
-		if ((panLoop.m_pos >= RCS_MAX_POS)||(panLoop.m_pos <= RCS_MIN_POS))
-		{
-			tiltLoop.m_pos = random(RCS_MAX_POS * 0.6, RCS_MAX_POS);
-			scanIncrement = -scanIncrement;
-			if (scanIncrement < 0)
-			{
-				motors.setLeftSpeed(-250);
-				motors.setRightSpeed(250);
-			}
-			else
-			{
-				motors.setLeftSpeed(+180);
-				motors.setRightSpeed(-180);
-			}
-			delay(random(250, 500));
-		}
- 
-		pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
-	}
-}
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.h	(revision 236)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-#endif /* _RCA_APP_H_ */
