diff --git a/docs/CommandLayer.rst b/docs/CommandLayer.rst
new file mode 100644
index 0000000000000000000000000000000000000000..64f2f15e546dafac226513d03bc12f5286b9af7a
--- /dev/null
+++ b/docs/CommandLayer.rst
@@ -0,0 +1,15 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+============
+CommandLayer
+============
+
+Command
+=======
+
+CommunicationInterface
+======================
+
diff --git a/docs/CommunicationLayer.rst b/docs/CommunicationLayer.rst
new file mode 100644
index 0000000000000000000000000000000000000000..aa4b3ae80374bffc81ef5bdc33c1f8c1e2ff7ad2
--- /dev/null
+++ b/docs/CommunicationLayer.rst
@@ -0,0 +1,17 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+==================
+CommunicationLayer
+==================
+
+USB
+===
+
+
+Bluetooth
+=========
+
+
diff --git a/docs/EV3.rst b/docs/EV3.rst
new file mode 100644
index 0000000000000000000000000000000000000000..bb679dc88652edb9e25f3339b2407d052e4307f5
--- /dev/null
+++ b/docs/EV3.rst
@@ -0,0 +1,12 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+EV3
+===
+
+.. autoclass:: EV3
+   :members: connect, disconnect, stopAllMotors, beep, playTone, stopTone, tonePlayed, setProperties
+
+
diff --git a/docs/Motor.rst b/docs/Motor.rst
new file mode 100644
index 0000000000000000000000000000000000000000..4e89a896e0b6aeccef31836a19ee29d3dd73eeb9
--- /dev/null
+++ b/docs/Motor.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+
+   <br />
+Motor
+=====
+
+.. autoclass:: Motor
+   :members: start, stop, syncedStart, syncedStop, waitFor, internalReset, resetTachoCount, setBrake, setProperties
diff --git a/docs/Sensor.rst b/docs/Sensor.rst
new file mode 100644
index 0000000000000000000000000000000000000000..0404ade83e4643e3b8dd830a8b428f1b06dfd4fa
--- /dev/null
+++ b/docs/Sensor.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+
+   <br />
+Sensor
+======
+
+.. autoclass:: Sensor
+   :members: reset, setProperties
diff --git a/docs/__pycache__/process.cpython-34.pyc b/docs/__pycache__/process.cpython-34.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..64ba10fe86362119ab3a4e3b6db72b12217361e7
Binary files /dev/null and b/docs/__pycache__/process.cpython-34.pyc differ
diff --git a/docs/_build/doctrees/CommandLayer.doctree b/docs/_build/doctrees/CommandLayer.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..451eac7f343fd7e974a21481df4ac98dc8bd5df1
Binary files /dev/null and b/docs/_build/doctrees/CommandLayer.doctree differ
diff --git a/docs/_build/doctrees/CommunicationLayer.doctree b/docs/_build/doctrees/CommunicationLayer.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..355337ddbe6b72d7f19aeb95ee24a9458023eef4
Binary files /dev/null and b/docs/_build/doctrees/CommunicationLayer.doctree differ
diff --git a/docs/_build/doctrees/EV3.doctree b/docs/_build/doctrees/EV3.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..f268aaa0ab05c97937dd1550fd354decce454983
Binary files /dev/null and b/docs/_build/doctrees/EV3.doctree differ
diff --git a/docs/_build/doctrees/Motor.doctree b/docs/_build/doctrees/Motor.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..002d4ff59880173f8926d242e29804f34c07f018
Binary files /dev/null and b/docs/_build/doctrees/Motor.doctree differ
diff --git a/docs/_build/doctrees/Sensor.doctree b/docs/_build/doctrees/Sensor.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..c15f329fef75f7b84f3e201fec31e5c7777ed2c9
Binary files /dev/null and b/docs/_build/doctrees/Sensor.doctree differ
diff --git a/docs/_build/doctrees/asd.doctree b/docs/_build/doctrees/asd.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..53aa4497320979052b586b7bee1da5be2f77c15e
Binary files /dev/null and b/docs/_build/doctrees/asd.doctree differ
diff --git a/docs/_build/doctrees/btBrickIO.doctree b/docs/_build/doctrees/btBrickIO.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..41720b5e50a9481d2562533c6c3dc1e3be9b113b
Binary files /dev/null and b/docs/_build/doctrees/btBrickIO.doctree differ
diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle
index 7794690289e5caa38b090c24f5e2fb653591fcbe..d0e3f355e446c8d3a8357f6b613a283c3415490b 100644
Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ
diff --git a/docs/_build/doctrees/examples.doctree b/docs/_build/doctrees/examples.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..a9a4aba4ea21fb7062ac10890fba3a27aee4a3d1
Binary files /dev/null and b/docs/_build/doctrees/examples.doctree differ
diff --git a/docs/_build/doctrees/hid.doctree b/docs/_build/doctrees/hid.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..c5e55fe4c904ef0c2081a52aab250a2f1519df1a
Binary files /dev/null and b/docs/_build/doctrees/hid.doctree differ
diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree
index c924e02b3bc5de706158cadc046dae93df3b0221..19bbb9eaf0de3d7adee983c3abb8afa5a8938a92 100644
Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ
diff --git a/docs/_build/doctrees/readme.doctree b/docs/_build/doctrees/readme.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..10fd5a846a2c6469d73d1e9444d353551adab5fa
Binary files /dev/null and b/docs/_build/doctrees/readme.doctree differ
diff --git a/docs/_build/doctrees/source.doctree b/docs/_build/doctrees/source.doctree
index 907be8bf9fe3294647328ac7ff4db17df046323a..a3349dabe5a1b10078cbc28a7f0a0b93973136df 100644
Binary files a/docs/_build/doctrees/source.doctree and b/docs/_build/doctrees/source.doctree differ
diff --git a/docs/_build/doctrees/test.doctree b/docs/_build/doctrees/test.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..9f4d998babc5a66a3eea5e256010b5c666632ba6
Binary files /dev/null and b/docs/_build/doctrees/test.doctree differ
diff --git a/docs/_build/doctrees/usbBrickIO.doctree b/docs/_build/doctrees/usbBrickIO.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..8c63e70472f80bd11bfe7873c0485d7a52c2ac41
Binary files /dev/null and b/docs/_build/doctrees/usbBrickIO.doctree differ
diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo
index 2f914f46cb0793f7cc02b51eb2ff4d61c3be649c..a8f899b5d98c61fad6edf9f82630d8a2ccc5e335 100644
--- a/docs/_build/html/.buildinfo
+++ b/docs/_build/html/.buildinfo
@@ -1,4 +1,4 @@
 # Sphinx build info version 1
 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 5962c7d7ff4477f5fe69f4114d507ce9
+config: 42809051028c0ea2e31137f7f9be60d4
 tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/_build/html/CommandLayer.html b/docs/_build/html/CommandLayer.html
new file mode 100644
index 0000000000000000000000000000000000000000..cfa7980cae94034d8e268489073dbbd255aa84f1
--- /dev/null
+++ b/docs/_build/html/CommandLayer.html
@@ -0,0 +1,162 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>CommandLayer &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">CommandLayer</a><ul>
+<li><a class="reference internal" href="#command">Command</a></li>
+<li><a class="reference internal" href="#communicationinterface">CommunicationInterface</a></li>
+</ul>
+</li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/CommandLayer.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="commandlayer">
+<h1>CommandLayer<a class="headerlink" href="#commandlayer" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="command">
+<h2>Command<a class="headerlink" href="#command" title="Permalink to this headline">¶</a></h2>
+</div>
+<div class="section" id="communicationinterface">
+<h2>CommunicationInterface<a class="headerlink" href="#communicationinterface" title="Permalink to this headline">¶</a></h2>
+</div>
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/CommunicationLayer.html b/docs/_build/html/CommunicationLayer.html
new file mode 100644
index 0000000000000000000000000000000000000000..470f3488002c41efa2c40a849dedeab4f7de7fb2
--- /dev/null
+++ b/docs/_build/html/CommunicationLayer.html
@@ -0,0 +1,162 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>CommunicationLayer &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">CommunicationLayer</a><ul>
+<li><a class="reference internal" href="#usb">USB</a></li>
+<li><a class="reference internal" href="#bluetooth">Bluetooth</a></li>
+</ul>
+</li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/CommunicationLayer.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="communicationlayer">
+<h1>CommunicationLayer<a class="headerlink" href="#communicationlayer" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="usb">
+<h2>USB<a class="headerlink" href="#usb" title="Permalink to this headline">¶</a></h2>
+</div>
+<div class="section" id="bluetooth">
+<h2>Bluetooth<a class="headerlink" href="#bluetooth" title="Permalink to this headline">¶</a></h2>
+</div>
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/EV3.html b/docs/_build/html/EV3.html
new file mode 100644
index 0000000000000000000000000000000000000000..a189e2ef587a4ee1c74779535e946ac204408b39
--- /dev/null
+++ b/docs/_build/html/EV3.html
@@ -0,0 +1,427 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>EV3 &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+    <link rel="next" title="Motor" href="Motor.html" />
+    <link rel="prev" title="MATLAB Toolbox for controlling Lego Mindstorms EV3" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">EV3</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="index.html" title="Previous Chapter: MATLAB Toolbox for controlling Lego Mindstorms EV3"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; MATLAB Toolbo...</span>
+    </a>
+  </li>
+  <li>
+    <a href="Motor.html" title="Next Chapter: Motor"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Motor &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/EV3.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="ev3">
+<h1>EV3<a class="headerlink" href="#ev3" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.EV3">
+<em class="property">class </em><code class="descname">EV3</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.EV3.connect" title="source.EV3.connect"><code class="xref mat mat-meth docutils literal"><span class="pre">connect()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.disconnect" title="source.EV3.disconnect"><code class="xref mat mat-meth docutils literal"><span class="pre">disconnect()</span></code></a></li>
+<li><code class="xref mat mat-meth docutils literal"><span class="pre">stopAllMotors()</span></code></li>
+<li><a class="reference internal" href="#source.EV3.beep" title="source.EV3.beep"><code class="xref mat mat-meth docutils literal"><span class="pre">beep()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.playTone" title="source.EV3.playTone"><code class="xref mat mat-meth docutils literal"><span class="pre">playTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.stopTone" title="source.EV3.stopTone"><code class="xref mat mat-meth docutils literal"><span class="pre">stopTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.tonePlayed" title="source.EV3.tonePlayed"><code class="xref mat mat-meth docutils literal"><span class="pre">tonePlayed()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.setProperties" title="source.EV3.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with physical bricks.</p>
+<p>This is the 'central' class (from user's view) when working with this toolbox. It
+delivers a convenient interface for creating a connection to the brick and sending
+commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for each port.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Creating multiple EV3 objects and connecting them to different physical bricks has not
+been thoroughly tested yet, but seems to work on a first glance.</li>
+<li>When an input argument of a method is marked as optional, the argument needs to be
+'announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: <em>brickObject.motorA.setProperties('power', 50);</em></li>
+</ul>
+<dl class="attribute">
+<dt id="source.EV3.motorA">
+<code class="descname">motorA</code><a class="headerlink" href="#source.EV3.motorA" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port A. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.motorB">
+<code class="descname">motorB</code><a class="headerlink" href="#source.EV3.motorB" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port B. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.motorC">
+<code class="descname">motorC</code><a class="headerlink" href="#source.EV3.motorC" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port C. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.motorD">
+<code class="descname">motorD</code><a class="headerlink" href="#source.EV3.motorD" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port D. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.sensor1">
+<code class="descname">sensor1</code><a class="headerlink" href="#source.EV3.sensor1" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 1. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.sensor2">
+<code class="descname">sensor2</code><a class="headerlink" href="#source.EV3.sensor2" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 2. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.sensor3">
+<code class="descname">sensor3</code><a class="headerlink" href="#source.EV3.sensor3" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 3. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.sensor4">
+<code class="descname">sensor4</code><a class="headerlink" href="#source.EV3.sensor4" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 4. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.EV3.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric in {0,1,2}</em> &#8211; Debug mode. <em>[WRITABLE]</em></p>
+<ul class="simple">
+<li>0: Debug turned off</li>
+<li>1: Debug turned on for EV3-object -&gt; enables feedback in the console about what firmware-commands have been called when using a method</li>
+<li>2: Low-level-Debug turned on -&gt; each packet sent and received is printed to the console</li>
+</ul>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.batteryMode">
+<code class="descname">batteryMode</code><a class="headerlink" href="#source.EV3.batteryMode" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string in {'Percentage', 'Voltage'}</em> &#8211; Mode for reading battery charge. See also <a class="reference internal" href="#source.EV3.batteryValue" title="source.EV3.batteryValue"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryValue</span></code></a>. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.batteryValue">
+<code class="descname">batteryValue</code><a class="headerlink" href="#source.EV3.batteryValue" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Current battery charge. Depending on batteryMode, the reading is either in percentage or voltage. See also <a class="reference internal" href="#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a>. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.EV3.isConnected">
+<code class="descname">isConnected</code><a class="headerlink" href="#source.EV3.isConnected" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; True if virtual brick-object is connected to physical one. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<p class="rubric">Example</p>
+<p>% This example expects a motor at port A and a (random) sensor at port 1 <br />
+b = EV3(); % <br />
+b.connect('usb'); % <br />
+ma = b.motorA; % <br />
+ma.setProperties('power', 50, 'limitValue', 720); % <br />
+ma.start(); % <br />
+% fun <br />
+ma.waitFor(); % <br />
+disp(b.sensor1.value); % <br />
+b.beep(); % <br />
+delete b; % <br /></p>
+<dl class="method">
+<dt id="source.EV3.beep">
+<code class="descname">beep</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.beep" title="Permalink to this definition">¶</a></dt>
+<dd><p>Plays a 'beep'-tone on brick.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This equals playTone(10, 1000, 100).</li>
+</ul>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.beep(); % <br /></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.EV3.connect">
+<code class="descname">connect</code><span class="sig-paren">(</span><em>ev3</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.connect" title="Permalink to this definition">¶</a></dt>
+<dd><p>Connects EV3-object and its Motors and Sensors to physical brick.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>connectionType</strong> (<em>string in {'bt', 'usb'}</em>) &#8211; Connection type</li>
+<li><strong>serPort</strong> (<em>string in {'/dev/rfcomm1', '/dev/rfcomm2', ...}</em>) &#8211; Path to serial port
+(necessary if connectionType is 'bt'). <em>[OPTIONAL]</em></li>
+<li><strong>beep</strong> (<em>bool</em>) &#8211; If true, EV3 beeps if connection has been established. <em>[OPTIONAL]</em></li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Example</p>
+<p>% Setup bluetooth connection via com-port 0 <br />
+b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+% Setup usb connection, beep when connection has been established
+b = EV3(); % <br />
+b.connect('usb', 'beep', 'on', ); % <br /></p>
+<p>See also ISCONNECTED / <a class="reference internal" href="#source.EV3.isConnected" title="source.EV3.isConnected"><code class="xref mat mat-attr docutils literal"><span class="pre">isConnected</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.EV3.disconnect">
+<code class="descname">disconnect</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.disconnect" title="Permalink to this definition">¶</a></dt>
+<dd><p>Disconnects EV3-object and its Motors and Sensors from physical brick.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when EV3-object is destroyed.</li>
+</ul>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+% do stuff <br />
+b.disconnect(); % <br /></p>
+<p>Resetting needs a working connection in order to send reset-commands
+to the Brick. If the connection has been aborted (e.g. by pulling the
+USB-cord), the reset-methods would fail -&gt; catch this error and for
+now do nothing.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.EV3.playTone">
+<code class="descname">playTone</code><span class="sig-paren">(</span><em>ev3</em>, <em>volume</em>, <em>frequency</em>, <em>duration</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.playTone" title="Permalink to this definition">¶</a></dt>
+<dd><p>Plays tone on brick.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>volume</strong> (<em>numeric in [0, 100]</em>) &#8211; in percent</li>
+<li><strong>frequency</strong> (<em>numeric in [250, 10000]</em>) &#8211; in Hertz</li>
+<li><strong>duration</strong> (<em>numeric &gt; 0</em>) &#8211; in milliseconds</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.playTone(40, 5000, 1000);  % Plays tone with 40% volume and 5000Hz for 1
+second. <br /></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.EV3.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>ev3</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set multiple EV3 properties at once using MATLAB's inputParser.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>debug</strong> (<em>numeric in {0,1,2}</em>) &#8211; see EV3.debug <em>[OPTIONAL]</em></li>
+<li><strong>batteryMode</strong> (<em>string in {'Voltage'/'Percentage'}</em>) &#8211; see EV3.batteryMode <em>[OPTIONAL]</em></li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.setProperties('debug', 'on', 'batteryMode', 'Voltage'); % <br />
+% Instead of: b.debug = 'on'; b.batteryMode = 'Voltage'; % <br /></p>
+<p>See also EV3.DEBUG, EV3.BATTERYMODE / <a class="reference internal" href="#source.EV3.debug" title="source.EV3.debug"><code class="xref mat mat-attr docutils literal"><span class="pre">debug</span></code></a>, <a class="reference internal" href="#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.EV3.stopTone">
+<code class="descname">stopTone</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.stopTone" title="Permalink to this definition">¶</a></dt>
+<dd><p>Stops tone currently played.</p>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.playTone(10,100,100000000);  % Accidentally given wrong tone duration :) <br />
+b.stopTone();  % Stops tone immediately. <br /></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.EV3.tonePlayed">
+<code class="descname">tonePlayed</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.tonePlayed" title="Permalink to this definition">¶</a></dt>
+<dd><p>Tests if tone is currently played.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>status</strong> &#8211; True if a tone is being played</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Example</dt>
+<dd>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.playTone(10, 100, 1000); % <br />
+pause(0.5); % Small pause is necessary as tone does not start instantaneously <br />
+b.tonePlayed(); % -&gt; Outputs 1 to console.  <br /></dd>
+</dl>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/Motor.html b/docs/_build/html/Motor.html
new file mode 100644
index 0000000000000000000000000000000000000000..dbad6f263b3f2c7a86ce3238e0832c65faafc4f8
--- /dev/null
+++ b/docs/_build/html/Motor.html
@@ -0,0 +1,468 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Motor &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+    <link rel="next" title="Sensor" href="Sensor.html" />
+    <link rel="prev" title="EV3" href="EV3.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">Motor</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="EV3.html" title="Previous Chapter: EV3"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; EV3</span>
+    </a>
+  </li>
+  <li>
+    <a href="Sensor.html" title="Next Chapter: Sensor"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Sensor &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/Motor.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="motor">
+<h1>Motor<a class="headerlink" href="#motor" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.Motor">
+<em class="property">class </em><code class="descname">Motor</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.Motor.start" title="source.Motor.start"><code class="xref mat mat-meth docutils literal"><span class="pre">start()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.stop" title="source.Motor.stop"><code class="xref mat mat-meth docutils literal"><span class="pre">stop()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.syncedStart" title="source.Motor.syncedStart"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStart()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.syncedStop" title="source.Motor.syncedStop"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStop()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.waitFor" title="source.Motor.waitFor"><code class="xref mat mat-meth docutils literal"><span class="pre">waitFor()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.internalReset" title="source.Motor.internalReset"><code class="xref mat mat-meth docutils literal"><span class="pre">internalReset()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.resetTachoCount" title="source.Motor.resetTachoCount"><code class="xref mat mat-meth docutils literal"><span class="pre">resetTachoCount()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.setBrake" title="source.Motor.setBrake"><code class="xref mat mat-meth docutils literal"><span class="pre">setBrake()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.setProperties" title="source.Motor.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with motors.</p>
+<p>This class is supposed to ease the use of the brick's motors. It is possible to set all
+kinds of parameters, request the current status of the motor ports and of course send
+commands to the brick to be executed on the respective port.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>You don't need to create instances of this class. The EV3-class automatically creates
+instances for each motor port, and you can work with them via the EV3-object.</li>
+<li>The Motor-class represents motor ports, not individual motors!</li>
+<li>If you start a motor with power=0, the internal state will still be set to
+'isRunning'</li>
+<li>When an input argument of a method is marked as optional, the argument needs to be
+'announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: <em>brickObject.motorA.setProperties('power', 50);</em></li>
+</ul>
+<dl class="attribute">
+<dt id="source.Motor.power">
+<code class="descname">power</code><a class="headerlink" href="#source.Motor.power" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric in [-100, 100]</em> &#8211; Power level of motor in percent. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.speedRegulation">
+<code class="descname">speedRegulation</code><a class="headerlink" href="#source.Motor.speedRegulation" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; Speed regulation turned on or off. When turned on, motor will
+try to 'hold' its speed at given power level, whatever the load. In this mode, the
+highest possible speed depends on the load and mostly goes up to around 70-80 (at
+this point, the Brick internally inputs 100% power). When turned off, motor will
+constantly input the same power into the motor. The resulting speed will be
+somewhat lower, depending on the load. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.smoothStart">
+<code class="descname">smoothStart</code><a class="headerlink" href="#source.Motor.smoothStart" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric s. t. smoothStart+smoothStop &lt; limitValue</em> &#8211; Degrees/Time
+indicating how far/long the motor should smoothly start. Depending on limitMode,
+the input is interpreted either in degrees or milliseconds. The first
+{smoothStart}-milliseconds/degrees of limitValue the motor will slowly accelerate
+until reaching its defined speed. See also <a class="reference internal" href="#source.Motor.limitValue" title="source.Motor.limitValue"><code class="xref mat mat-attr docutils literal"><span class="pre">limitValue</span></code></a>, <a class="reference internal" href="#source.Motor.limitMode" title="source.Motor.limitMode"><code class="xref mat mat-attr docutils literal"><span class="pre">limitMode</span></code></a>. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.smoothStop">
+<code class="descname">smoothStop</code><a class="headerlink" href="#source.Motor.smoothStop" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric s. t. smoothStart+smoothStop &lt; limitValue</em> &#8211; Degrees/Time
+indicating how far/long the motor should smoothly stop. Depending on limitMode, the
+input is interpreted either in degrees or milliseconds. The last
+[smoothStop]-milliseconds/degrees of limitValue the motor will slowly slow down
+until it has stopped. See also <a class="reference internal" href="#source.Motor.limitValue" title="source.Motor.limitValue"><code class="xref mat mat-attr docutils literal"><span class="pre">limitValue</span></code></a>, <a class="reference internal" href="#source.Motor.limitMode" title="source.Motor.limitMode"><code class="xref mat mat-attr docutils literal"><span class="pre">limitMode</span></code></a>. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.limitValue">
+<code class="descname">limitValue</code><a class="headerlink" href="#source.Motor.limitValue" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric&gt;=0</em> &#8211; Degrees/Time indicating how far/long the motor should run.
+Depending on limitMode, the input is interpreted either in degrees or
+milliseconds. See also <a class="reference internal" href="#source.Motor.limitMode" title="source.Motor.limitMode"><code class="xref mat mat-attr docutils literal"><span class="pre">limitMode</span></code></a>. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.limitMode">
+<code class="descname">limitMode</code><a class="headerlink" href="#source.Motor.limitMode" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>'Tacho'|'Time'</em> &#8211; Mode for motor limit. See also <a class="reference internal" href="#source.Motor.limitValue" title="source.Motor.limitValue"><code class="xref mat mat-attr docutils literal"><span class="pre">limitValue</span></code></a>. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.brakeMode">
+<code class="descname">brakeMode</code><a class="headerlink" href="#source.Motor.brakeMode" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>'Brake'|'Coast'</em> &#8211; Action done when stopping. If 'Coast', the motor will (at
+tacholimit, if ~=0) coast to a stop. If 'Brake', the motor will stop immediately
+(at tacholimit, if ~=0) and hold the brake. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.Motor.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; Debug turned on or off. In debug mode, everytime a command is passed to
+the sublayer ('communication layer'), there is feedback in the console about what
+command has been called. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.isRunning">
+<code class="descname">isRunning</code><a class="headerlink" href="#source.Motor.isRunning" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; True if motor is running. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.tachoCount">
+<code class="descname">tachoCount</code><a class="headerlink" href="#source.Motor.tachoCount" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Current tacho count in degrees. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.currentSpeed">
+<code class="descname">currentSpeed</code><a class="headerlink" href="#source.Motor.currentSpeed" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Current speed of motor. If speedRegulation=on this should equal power,
+otherwise it will probably be lower than that. See also <a class="reference internal" href="#source.Motor.speedRegulation" title="source.Motor.speedRegulation"><code class="xref mat mat-attr docutils literal"><span class="pre">speedRegulation</span></code></a>. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Motor.type">
+<code class="descname">type</code><a class="headerlink" href="#source.Motor.type" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>DeviceType</em> &#8211; Type of connected device if any. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.internalReset">
+<code class="descname">internalReset</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.internalReset" title="Permalink to this definition">¶</a></dt>
+<dd><p>Resets internal tacho count. Use this if motor behaves weird (i.e. not starting at all, or not correctly
+running to limitValue).</p>
+<p>The internal tacho count is used for positioning the motor. When the
+motor is running with a tacho limit, internally it uses another counter than the
+one read by tachoCount. This internal tacho count needs to be reset if you
+physically change the motor's position or it coasted into a stop. If the motor's
+brakemode is 'Coast', this function is called automatically.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>A better name would probably be resetPosition...</li>
+<li>Gets called automatically when starting the motor and the internal tacho count is &gt; 0</li>
+</ul>
+<p>See also MOTOR.RESETTACHOCOUNT / <a class="reference internal" href="#source.Motor.resetTachoCount" title="source.Motor.resetTachoCount"><code class="xref mat mat-attr docutils literal"><span class="pre">resetTachoCount</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.resetTachoCount">
+<code class="descname">resetTachoCount</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.resetTachoCount" title="Permalink to this definition">¶</a></dt>
+<dd><p>Resets tachocount.</p>
+<p>See also MOTOR.TACHOCOUNT / <a class="reference internal" href="#source.Motor.tachoCount" title="source.Motor.tachoCount"><code class="xref mat mat-attr docutils literal"><span class="pre">tachoCount</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.setBrake">
+<code class="descname">setBrake</code><span class="sig-paren">(</span><em>motor</em>, <em>brake</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.setBrake" title="Permalink to this definition">¶</a></dt>
+<dd><p>Apply or release brake of motor.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>brake</strong> (<em>bool</em>) &#8211; If true, brake will be pulled</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This method does not affect Motor.brakeMode. After the next run, the motor
+will again be stopped as specified in Motor.brakeMode.</li>
+</ul>
+<p>See also MOTOR.BRAKEMODE / <a class="reference internal" href="#source.Motor.brakeMode" title="source.Motor.brakeMode"><code class="xref mat mat-attr docutils literal"><span class="pre">brakeMode</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>motor</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sets multiple Motor properties at once using MATLAB's inputParser.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>debug</strong> (<em>bool</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>smoothStart</strong> (<em>numeric in [0, limitValue]</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>smoothStop</strong> (<em>numeric in [0, limitValue]</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>speedRegulation</strong> (<em>bool</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>brakeMode</strong> (<em>'Coast'|'Brake'</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>limitMode</strong> (<em>'Time'|'Tacho'</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>limitValue</strong> (<em>numeric &gt; 0</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>power</strong> (<em>numeric in [-100,100]</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>batteryMode</strong> (<em>'Voltage'|'Percentage'</em>) &#8211; <em>[OPTIONAL]</em></li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.motorA.setProperties('debug', 'on', 'power', 50, 'limitValue', 720, 'speedRegulation', 'on'); % <br />
+% Instead of: b.motorA.debug = 'on'; <br />
+%             b.motorA.power = 50; <br />
+%             b.motorA.limitValue = 720; <br />
+%             b.motorA.speedRegulation = 'on'; <br /></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.start">
+<code class="descname">start</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.start" title="Permalink to this definition">¶</a></dt>
+<dd><p>Starts the motor.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.stop">
+<code class="descname">stop</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.stop" title="Permalink to this definition">¶</a></dt>
+<dd><p>Stops the motor.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>If this motor has been started synced with another one (either as master or
+slave, using Motor.syncedStart), syncedStop() will be called, stopping both
+motors.</li>
+</ul>
+<p>See also MOTOR.START, MOTOR.SYNCEDSTOP / <a class="reference internal" href="#source.Motor.start" title="source.Motor.start"><code class="xref mat mat-meth docutils literal"><span class="pre">start()</span></code></a>, <a class="reference internal" href="#source.Motor.syncedStop" title="source.Motor.syncedStop"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStop()</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.syncedStart">
+<code class="descname">syncedStart</code><span class="sig-paren">(</span><em>motor</em>, <em>syncMotor</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.syncedStart" title="Permalink to this definition">¶</a></dt>
+<dd><p>Starts this motor synchronized with another.</p>
+<p>The motor, with which this method is called, acts as a <em>master</em>, meaning that the
+synchronized control is done with it und uses its parameters. When syncedStart is
+called, the master sets some of the slave's (syncMotor) properties to keep it
+consistent with the physical brick. So, for example, if the master has another
+power-value than the slave, the slave's power-value will be set to that of the
+master when syncedStart() is called.
+The following parameters will be affected on the slave: <em>power</em>, <em>brakeMode</em>,
+<em>limitValue</em>, <em>speedRegulation</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>syncMotor</strong> (<em>Motor</em>) &#8211; The motor-object to sync with</li>
+<li><strong>turnRatio</strong> (<em>numeric in [-200,200]</em>) &#8211; Ratio between the two master's and the
+slave's motor speed. With values!=0 one motor will be slower than the other
+or even turn into the other direction. This can be used for turning car-like
+robots, for example. <em>[OPTIONAL]</em> (Read in Firmware-comments in c_output.c): <br />
+-&gt; 0 is moving straight forward <br />
+-&gt; Negative values turn to the left <br />
+-&gt; Positive values turn to the right <br />
+-&gt; Value -100 stops the left motor <br />
+-&gt; Value +100 stops the right motor <br />
+-&gt; Values less than -100 makes the left motor run the opposite direction of the right motor (Spin) <br />
+-&gt; Values greater than +100 makes the right motor run the opposite direction of the left motor (Spin) <br /></li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This is a pretty 'heavy' function, as it tests if both motors are
+connected AND aren't running, wasting four packets, keep that in mind.</li>
+</ul>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('usb'); % <br />
+m = b.motorA; % <br />
+slave = b.motorB; % <br />
+m.power = 50; % <br />
+m.syncedStart(slave); % <br />
+% Do stuff <br />
+m.stop(); % <br /></p>
+<p>See also MOTOR.STOP, MOTOR.SYNCEDSTOP / <a class="reference internal" href="#source.Motor.stop" title="source.Motor.stop"><code class="xref mat mat-meth docutils literal"><span class="pre">stop()</span></code></a>, <a class="reference internal" href="#source.Motor.syncedStop" title="source.Motor.syncedStop"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStop()</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.syncedStop">
+<code class="descname">syncedStop</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.syncedStop" title="Permalink to this definition">¶</a></dt>
+<dd><p>Stops both motors previously started with syncedStart.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This method is called automatically by stop(), if the motors have been
+started using syncedStart, and the regular stop-method has been called afterwards.</li>
+</ul>
+<p>See also MOTOR.SYNCEDSTART, MOTOR.STOP / <a class="reference internal" href="#source.Motor.syncedStart" title="source.Motor.syncedStart"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStart()</span></code></a>, <a class="reference internal" href="#source.Motor.stop" title="source.Motor.stop"><code class="xref mat mat-meth docutils literal"><span class="pre">stop()</span></code></a></p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Motor.waitFor">
+<code class="descname">waitFor</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.waitFor" title="Permalink to this definition">¶</a></dt>
+<dd><p>Stops execution of program as long as motor is running.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This one's a bit tricky. The opCode which is supposed to be used here, OutputReady,
+makes the brick stop sending
+responses until the motor has stopped. For security reasons, in this toolbox
+there is an internal timeout for receiving messages from the brick. It raises
+an error if a reply takes too long, which would happen in this case. As a
+workaround, there is an infinite loop that catches errors from outputReady and
+continues then, until outputReady will actually finish without an error.</li>
+<li>Workaround: Poll isRunning until it is false (No need to check if motor is
+connected as speed correctly returns 0 if it's not)</li>
+</ul>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/Sensor.html b/docs/_build/html/Sensor.html
new file mode 100644
index 0000000000000000000000000000000000000000..937f91b8fe6e7297531e145e50fe1b7e9a19a3e6
--- /dev/null
+++ b/docs/_build/html/Sensor.html
@@ -0,0 +1,410 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Sensor &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+    <link rel="next" title="hidapi" href="hid.html" />
+    <link rel="prev" title="Motor" href="Motor.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">Sensor</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="Motor.html" title="Previous Chapter: Motor"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Motor</span>
+    </a>
+  </li>
+  <li>
+    <a href="hid.html" title="Next Chapter: hidapi"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">hidapi &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/Sensor.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="sensor">
+<h1>Sensor<a class="headerlink" href="#sensor" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.Sensor">
+<em class="property">class </em><code class="descname">Sensor</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.Sensor.reset" title="source.Sensor.reset"><code class="xref mat mat-meth docutils literal"><span class="pre">reset()</span></code></a></li>
+<li><a class="reference internal" href="#source.Sensor.setProperties" title="source.Sensor.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with sensors.</p>
+<p>The Sensor-class facilitates the communication with sensors. This mainly consists of
+reading the sensor's type and current value in a specified mode.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>You don't need to create instances of this class. The EV3-class automatically creates
+instances for each sensor port, and you can work with them via the EV3-object.</li>
+<li>The Sensor-class represents sensor ports, not individual sensors!</li>
+<li>When an input argument of a method is marked as optional, the argument needs to be
+'announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: <em>brickObject.motorA.setProperties('power', 50);</em></li>
+</ul>
+<dl class="attribute">
+<dt id="source.Sensor.mode">
+<code class="descname">mode</code><a class="headerlink" href="#source.Sensor.mode" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>DeviceMode.{Type}</em> &#8211; Sensor mode in which the value will be read. By default, mode is set to <em>DeviceMode.Default.Undefined</em>. See also <a class="reference internal" href="#source.Sensor.type" title="source.Sensor.type"><code class="xref mat mat-attr docutils literal"><span class="pre">type</span></code></a>. <em>[WRITABLE]</em> <br /> Once a physical sensor is connected to the port <em>and</em> the physical Brick is connected to the EV3-object, the allowed mode and the default mode for a Sensor-object are the following (depending on the sensor type):</p>
+<ul>
+<li><dl class="first docutils">
+<dt>Touch-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.Touch.Pushed <em>[Default]</em></li>
+<li>DeviceMode.Touch.Bumps</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>Ultrasonic-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.UltraSonic.DistCM <em>[Default]</em></li>
+<li>DeviceMode.UltraSonic.DistIn</li>
+<li>DeviceMode.UltraSonic.Listen</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>Color-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.Color.Reflect <em>[Default]</em></li>
+<li>DeviceMode.Color.Ambient</li>
+<li>DeviceMode.Color.Col</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>Gyro-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.Gyro.Angular <em>[Default]</em></li>
+<li>DeviceMode.Gyro.Rate</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>Infrared-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.InfraRed.Prox <em>[Default]</em></li>
+<li>DeviceMode.InfraRed.Seek</li>
+<li>DeviceMode.InfraRed.Remote</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>NXTColor-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.NXTColor.Reflect <em>[Default]</em></li>
+<li>DeviceMode.NXTColor.Ambient</li>
+<li>DeviceMode.NXTColor.Color</li>
+<li>DeviceMode.NXTColor.Green</li>
+<li>DeviceMode.NXTColor.Blue</li>
+<li>DeviceMode.NXTColor.Raw</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>NXTLight-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.NXTLight.Reflect <em>[Default]</em></li>
+<li>DeviceMode.NXTLight.Ambient</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>NXTSound-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.NXTSound.DB <em>[Default]</em></li>
+<li>DeviceMode.NXTSound.DBA</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>NXTTemperature-Sensor</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.NXTTemperature.C <em>[Default]</em></li>
+<li>DeviceMode.NXTTemperature.F</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>NXTTouch-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.NXTTouch.Pushed <em>[Default]</em></li>
+<li>DeviceMode.NXTTouch.Bumps</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>NXTUltraSonic-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.NXTUltraSonic.CM <em>[Default]</em></li>
+<li>DeviceMode.NXTUltraSonic.IN</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>HTAccelerometer-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.HTAccelerometer.Acceleration <em>[Default]</em></li>
+<li>DeviceMode.HTAccelerometer.AccelerationAllAxes</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>HTCompass-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.HTCompass.Degrees <em>[Default]</em></li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><dl class="first docutils">
+<dt>HTColor-Sensor:</dt>
+<dd><ul class="first last simple">
+<li>DeviceMode.HTColor.Col <em>[Default]</em></li>
+<li>DeviceMode.HTColor.Red</li>
+<li>DeviceMode.HTColor.Green</li>
+<li>DeviceMode.HTColor.Blue</li>
+<li>DeviceMode.HTColor.White</li>
+<li>DeviceMode.HTColor.Raw</li>
+<li>DeviceMode.HTColor.Nr,</li>
+<li>DeviceMode.HTColor.All</li>
+</ul>
+</dd>
+</dl>
+</li>
+</ul>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Sensor.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.Sensor.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; Debug turned on or off. In debug mode, everytime a command is passed to
+the sublayer ('communication layer'), there is feedback in the console about what
+command has been called. <em>[WRITABLE]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Sensor.value">
+<code class="descname">value</code><a class="headerlink" href="#source.Sensor.value" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Value read from hysical sensor. What the value represents depends on
+<a class="reference internal" href="#source.Sensor.mode" title="source.Sensor.mode"><code class="xref mat mat-attr docutils literal"><span class="pre">mode</span></code></a>. <em>[READ-ONLY]</em></p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.Sensor.type">
+<code class="descname">type</code><a class="headerlink" href="#source.Sensor.type" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>DeviceType</em> &#8211; Type of physical sensor connected to the port. Possible types are: [READ-ONLY]</p>
+<ul class="simple">
+<li>DeviceType.NXTTouch</li>
+<li>DeviceType.NXTLight</li>
+<li>DeviceType.NXTSound</li>
+<li>DeviceType.NXTColor</li>
+<li>DeviceType.NXTUltraSonic</li>
+<li>DeviceType.NXTTemperature</li>
+<li>DeviceType.LargeMotor</li>
+<li>DeviceType.MediumMotor</li>
+<li>DeviceType.Touch</li>
+<li>DeviceType.Color</li>
+<li>DeviceType.UltraSonic</li>
+<li>DeviceType.Gyro</li>
+<li>DeviceType.InfraRed</li>
+<li>DeviceType.HTColor</li>
+<li>DeviceType.HTCompass</li>
+<li>DeviceType.HTAccelerometer</li>
+<li>DeviceType.Unknown</li>
+<li>DeviceType.None</li>
+<li>DeviceType.Error</li>
+</ul>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Sensor.reset">
+<code class="descname">reset</code><span class="sig-paren">(</span><em>sensor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor.reset" title="Permalink to this definition">¶</a></dt>
+<dd><p>Resets sensor value.</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Has not been thoroughly tested but seems to work as expected</li>
+</ul>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.Sensor.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>sensor</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sets multiple Sensor properties at once using MATLAB's inputParser.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>debug</strong> (<em>bool</em>) &#8211; <em>[OPTIONAL]</em></li>
+<li><strong>mode</strong> (<em>DeviceMode.{Type}</em>) &#8211; <em>[OPTIONAL]</em></li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Example</p>
+<p>b = EV3(); % <br />
+b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
+b.sensor1.setProperties('debug', 'on', 'mode', DeviceMode.Color.Ambient); % <br />
+% Instead of: b.sensor1.debug = 'on'; <br />
+%             b.sensor1.mode = DeviceMode.Color.Ambient; <br /></p>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/_sources/CommandLayer.txt b/docs/_build/html/_sources/CommandLayer.txt
new file mode 100644
index 0000000000000000000000000000000000000000..64f2f15e546dafac226513d03bc12f5286b9af7a
--- /dev/null
+++ b/docs/_build/html/_sources/CommandLayer.txt
@@ -0,0 +1,15 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+============
+CommandLayer
+============
+
+Command
+=======
+
+CommunicationInterface
+======================
+
diff --git a/docs/_build/html/_sources/CommunicationLayer.txt b/docs/_build/html/_sources/CommunicationLayer.txt
new file mode 100644
index 0000000000000000000000000000000000000000..aa4b3ae80374bffc81ef5bdc33c1f8c1e2ff7ad2
--- /dev/null
+++ b/docs/_build/html/_sources/CommunicationLayer.txt
@@ -0,0 +1,17 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+==================
+CommunicationLayer
+==================
+
+USB
+===
+
+
+Bluetooth
+=========
+
+
diff --git a/docs/_build/html/_sources/EV3.txt b/docs/_build/html/_sources/EV3.txt
new file mode 100644
index 0000000000000000000000000000000000000000..bb679dc88652edb9e25f3339b2407d052e4307f5
--- /dev/null
+++ b/docs/_build/html/_sources/EV3.txt
@@ -0,0 +1,12 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+EV3
+===
+
+.. autoclass:: EV3
+   :members: connect, disconnect, stopAllMotors, beep, playTone, stopTone, tonePlayed, setProperties
+
+
diff --git a/docs/_build/html/_sources/Motor.txt b/docs/_build/html/_sources/Motor.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4e89a896e0b6aeccef31836a19ee29d3dd73eeb9
--- /dev/null
+++ b/docs/_build/html/_sources/Motor.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+
+   <br />
+Motor
+=====
+
+.. autoclass:: Motor
+   :members: start, stop, syncedStart, syncedStop, waitFor, internalReset, resetTachoCount, setBrake, setProperties
diff --git a/docs/_build/html/_sources/Sensor.txt b/docs/_build/html/_sources/Sensor.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0404ade83e4643e3b8dd830a8b428f1b06dfd4fa
--- /dev/null
+++ b/docs/_build/html/_sources/Sensor.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+
+   <br />
+Sensor
+======
+
+.. autoclass:: Sensor
+   :members: reset, setProperties
diff --git a/docs/_build/html/_sources/asd.txt b/docs/_build/html/_sources/asd.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/docs/_build/html/_sources/btBrickIO.txt b/docs/_build/html/_sources/btBrickIO.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5e076d50dc1c141aef7ed955e216f4b3a438723c
--- /dev/null
+++ b/docs/_build/html/_sources/btBrickIO.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+btBrickIO
+=========
+
+.. autoclass:: btBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/docs/_build/html/_sources/examples.txt b/docs/_build/html/_sources/examples.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7023309f75ff7a2f34e0d931f293f138eab99c60
--- /dev/null
+++ b/docs/_build/html/_sources/examples.txt
@@ -0,0 +1,17 @@
+========
+Examples
+========
+
+.. code-block:: matlab
+
+	% This example expects a motor at port A and a (random) sensor at port 1 
+	b = EV3(); 
+	b.connect('usb'); 
+	ma = b.motorA; 
+	ma.setProperties('power', 50, 'limitValue', 720); 
+	ma.start(); 
+	% fun
+	ma.waitFor(); 
+	disp(b.sensor1.value); 
+	b.beep(); 
+	b.delete(); 
diff --git a/docs/_build/html/_sources/hid.txt b/docs/_build/html/_sources/hid.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a81e179691da5a39122479c305bd02a5f82a5619
--- /dev/null
+++ b/docs/_build/html/_sources/hid.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+hidapi
+======
+
+.. autoclass:: hidapi
+   :members: open, close, read, read_timeout, write, getHIDInfoString, setNonBlocking, init, exit, error, enumerate, getManufacturersString, getProductString, getSerialNumberString
diff --git a/docs/_build/html/_sources/index.txt b/docs/_build/html/_sources/index.txt
index 32339b8c15a093a9abd83ae2f95e974280f64bda..9ee56c01ac71e7761e2ef9b53c971f77a9372926 100644
--- a/docs/_build/html/_sources/index.txt
+++ b/docs/_build/html/_sources/index.txt
@@ -3,21 +3,33 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Toolbox for controlling Lego Mindstorms EV3 with MATLAB
-=======================================================
+==================================================
+MATLAB Toolbox for controlling Lego Mindstorms EV3
+==================================================
 
-Contents:
+Hi there! This is the documentation for the "Lego Mindstorms EV3" MATLAB Toolbox,
+developed by RWTH Aachen. For an introduction about this toolbox, installation
+guides and examples, take a look at `our repository`_.
 
-.. toctree::
-   :maxdepth: 4
+.. _our repository: https://git.rwth-aachen.de/mindstorms/ev3-toolbox-matlab/blob/master/readme.md
+
+Contents
+========
 
-   source
+High-Level documentation
 
+.. toctree::
+   :maxdepth: 2
 
-Indices and tables
-==================
+   EV3
+   Motor
+   Sensor
 
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+Low-Level documentation
+
+.. toctree::
+   :maxdepth: 3
 
+   hid
+   usbBrickIO
+   btBrickIO
diff --git a/docs/_build/html/_sources/readme.txt b/docs/_build/html/_sources/readme.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ddcfba5efbf31886070e6c0c8f8f87190c277a21
--- /dev/null
+++ b/docs/_build/html/_sources/readme.txt
@@ -0,0 +1,12 @@
+=======
+General
+=======
+
+Installation
+============
+
+Contribution
+============
+
+Licenses
+========
diff --git a/docs/_build/html/_sources/source.txt b/docs/_build/html/_sources/source.txt
index 589e1dd71f965275426b905e185bec519a40f781..bb679dc88652edb9e25f3339b2407d052e4307f5 100644
--- a/docs/_build/html/_sources/source.txt
+++ b/docs/_build/html/_sources/source.txt
@@ -10,16 +10,3 @@ EV3
    :members: connect, disconnect, stopAllMotors, beep, playTone, stopTone, tonePlayed, setProperties
 
 
-Motor
-=====
-
-.. autoclass:: Motor
-   :members: start, stop, syncedStart, syncedStop, waitFor, internalReset, resetTachoCount, setBrake, setProperties
-
-
-Sensor
-======
-
-.. autoclass:: Sensor
-   :members: reset, setProperties
-
diff --git a/docs/_build/html/_sources/test.txt b/docs/_build/html/_sources/test.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a81e179691da5a39122479c305bd02a5f82a5619
--- /dev/null
+++ b/docs/_build/html/_sources/test.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+hidapi
+======
+
+.. autoclass:: hidapi
+   :members: open, close, read, read_timeout, write, getHIDInfoString, setNonBlocking, init, exit, error, enumerate, getManufacturersString, getProductString, getSerialNumberString
diff --git a/docs/_build/html/_sources/usbBrickIO.txt b/docs/_build/html/_sources/usbBrickIO.txt
new file mode 100644
index 0000000000000000000000000000000000000000..785bdc9777327560b7982902df1a9df17ffb2cc9
--- /dev/null
+++ b/docs/_build/html/_sources/usbBrickIO.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+usbBrickIO
+==========
+
+.. autoclass:: usbBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/docs/_build/html/_static/bootstrap-sphinx.css b/docs/_build/html/_static/bootstrap-sphinx.css
index 3f397e1b7a4250aa7749aa5c4a59dcee5607b589..759bc88ee9ba234ef78238daceea15bb5311cf50 100644
--- a/docs/_build/html/_static/bootstrap-sphinx.css
+++ b/docs/_build/html/_static/bootstrap-sphinx.css
@@ -38,12 +38,12 @@
 
   body {
     
-      padding-top: 40px;
+      padding-top: 60px;
     
   }
   .page-top {
     
-      top: 40px;
+      top: 60px;
     
   }
 
@@ -60,12 +60,12 @@ table {
 }
 
 .highlighttable .code pre {
-    font-size: 12px;
+    font-size: 15px;
 }
 
 .highlighttable .linenos pre {
     word-break: normal;
-    font-size: 12px;
+    font-size: 15px;
 }
 
 div.highlight {
diff --git a/docs/_build/html/asd.html b/docs/_build/html/asd.html
new file mode 100644
index 0000000000000000000000000000000000000000..d0a257d4778fb87d4c0845ed7f956761a1cf8da5
--- /dev/null
+++ b/docs/_build/html/asd.html
@@ -0,0 +1,151 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>&lt;no title&gt; &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul class="simple">
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/asd.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/btBrickIO.html b/docs/_build/html/btBrickIO.html
new file mode 100644
index 0000000000000000000000000000000000000000..95bd5beed7fbece07a9635c50de01f0b39c37ce7
--- /dev/null
+++ b/docs/_build/html/btBrickIO.html
@@ -0,0 +1,286 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>btBrickIO &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+    <link rel="prev" title="usbBrickIO" href="usbBrickIO.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="usbBrickIO.html" title="Previous Chapter: usbBrickIO"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; usbBrickIO</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/btBrickIO.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="btbrickio">
+<h1>btBrickIO<a class="headerlink" href="#btbrickio" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.btBrickIO">
+<em class="property">class </em><code class="descname">btBrickIO</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.btBrickIO.open" title="source.btBrickIO.open"><code class="xref mat mat-meth docutils literal"><span class="pre">open()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.close" title="source.btBrickIO.close"><code class="xref mat mat-meth docutils literal"><span class="pre">close()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.read" title="source.btBrickIO.read"><code class="xref mat mat-meth docutils literal"><span class="pre">read()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.write" title="source.btBrickIO.write"><code class="xref mat mat-meth docutils literal"><span class="pre">write()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.setProperties" title="source.btBrickIO.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>Bluetooth interface between MATLAB and the brick</p>
+<p class="rubric">Notes</p>
+<ul>
+<li><p class="first">Connects to the bluetooth module on the host through a serial
+connection. Hence be sure that a serial connection to the bluetooth
+module can be made. Also be sure that the bluetooth module has been paired
+to the brick before trying to connect.</p>
+</li>
+<li><dl class="first docutils">
+<dt>Usage is OS-dependent:</dt>
+<dd><ul class="first last simple">
+<li>Windows: the deviceName- &amp; channel-properties are needed for connection. The implementation is based on the Instrument Control toolbox.</li>
+<li>Linux (and potentially Mac): serialPort-property is needed for connection. The implementation is based on MATLAB's serial port implementation.</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><p class="first">For general information, see also <code class="xref mat mat-class docutils literal"><span class="pre">BrickIO</span></code>.</p>
+</li>
+</ul>
+<dl class="attribute">
+<dt id="source.btBrickIO.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.btBrickIO.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; If true, each open/close/read/write-call will be shown in the console.
+Defaults to false.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.serialPort">
+<code class="descname">serialPort</code><a class="headerlink" href="#source.btBrickIO.serialPort" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Path to the serial-port object. Only needed when using MATLAB's
+serial class (i.e. on linux/mac). Defaults to '/dev/rfcomm0'.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.deviceName">
+<code class="descname">deviceName</code><a class="headerlink" href="#source.btBrickIO.deviceName" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of the BT-device = the brick. Only needed when using the
+Instrument Control toolbox (i.e. on windows). Defaults to 'EV3'.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.channel">
+<code class="descname">channel</code><a class="headerlink" href="#source.btBrickIO.channel" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric &gt; 0</em> &#8211; BT-channel of the connected BT-device. Only needed when using
+the Instrument Control toolbox (i.e. on windows). Defaults to 1.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.timeOut">
+<code class="descname">timeOut</code><a class="headerlink" href="#source.btBrickIO.timeOut" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric &gt;= 0</em> &#8211; seconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.backend">
+<code class="descname">backend</code><a class="headerlink" href="#source.btBrickIO.backend" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>'serial'|'instrumentControl'</em> &#8211; Backend this implementation is based on. Is
+automatically chosen depending on the OS. Defaults to 'serial' on linux/mac
+systems, and to 'instrumentControl' on windows systems.</p>
+</dd></dl>
+
+<p class="rubric">Examples</p>
+<p>% Connecting on windows <br />
+commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1); % <br />
+% Connecting on windows using MATLABs default serial port implementation for testing <br />
+commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1, 'backend', 'serial'); % <br />
+% Connecting on mac/linux <br />
+commHandle = btBrickIO('serPort', '/dev/rfcomm0'); % <br /></p>
+<dl class="method">
+<dt id="source.btBrickIO.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Closes the bluetooth connection the brick using fclose.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Opens the bluetooth connection to the brick using fopen.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Reads data from the brick through bluetooth via fread and returns the data in uint8 format.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>brickIO</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sets multiple btBrickIO properties at once using MATLAB's inputParser.</p>
+<p>The syntax is as follows: commHandle.setProperties('propertyName1',
+propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, serPort, deviceName, channel, timeout.</p>
+<p>See also BTBRICKIO.DEBUG, BTBRICKIO.SERIALPORT, BTBRICKIO.DEVICENAME,
+BTBRICKIO.CHANNEL, BTBRICKIO.TIMEOUT</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>brickIO</em>, <em>wmsg</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Writes data to the brick through bluetooth via fwrite.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>wmsg</strong> (<em>uint8 array</em>) &#8211; Data to be written to the brick via bluetooth</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/examples.html b/docs/_build/html/examples.html
new file mode 100644
index 0000000000000000000000000000000000000000..9254b0d6dda739f8b36b731d8f183cc2adaf2ec5
--- /dev/null
+++ b/docs/_build/html/examples.html
@@ -0,0 +1,165 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Examples &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">Examples</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/examples.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <div class="section" id="examples">
+<h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h1>
+<div class="highlight-matlab"><div class="highlight"><pre><span></span><span class="c">% This example expects a motor at port A and a (random) sensor at port 1</span>
+<span class="n">b</span> <span class="p">=</span> <span class="n">EV3</span><span class="p">();</span>
+<span class="n">b</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span><span class="s">&#39;usb&#39;</span><span class="p">);</span>
+<span class="n">ma</span> <span class="p">=</span> <span class="n">b</span><span class="p">.</span><span class="n">motorA</span><span class="p">;</span>
+<span class="n">ma</span><span class="p">.</span><span class="n">setProperties</span><span class="p">(</span><span class="s">&#39;power&#39;</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="s">&#39;limitValue&#39;</span><span class="p">,</span> <span class="mi">720</span><span class="p">);</span>
+<span class="n">ma</span><span class="p">.</span><span class="n">start</span><span class="p">();</span>
+<span class="c">% fun</span>
+<span class="n">ma</span><span class="p">.</span><span class="n">waitFor</span><span class="p">();</span>
+<span class="nb">disp</span><span class="p">(</span><span class="n">b</span><span class="p">.</span><span class="n">sensor1</span><span class="p">.</span><span class="n">value</span><span class="p">);</span>
+<span class="n">b</span><span class="p">.</span><span class="n">beep</span><span class="p">();</span>
+<span class="n">b</span><span class="p">.</span><span class="n">delete</span><span class="p">();</span>
+</pre></div>
+</div>
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html
index d5a11928440a916168201c860a5a18277bbb810b..a868ed34dffeba5f4ab547fbefc3fb2565611d69 100644
--- a/docs/_build/html/genindex.html
+++ b/docs/_build/html/genindex.html
@@ -6,18 +6,17 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Index &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    <title>Index &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
     
     <link rel="stylesheet" href="_static/basic.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
     <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
     
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     'v0.4-rc.10',
+        VERSION:     'v1.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -32,7 +31,7 @@
     <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
     <link rel="index" title="Index" href="#" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
 <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
@@ -52,7 +51,7 @@
         </button>
         <a class="navbar-brand" href="index.html">
           Mindstorms EV3 Toolbox</a>
-        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
       </div>
 
         <div class="collapse navbar-collapse nav-collapse">
@@ -68,9 +67,14 @@
   <ul class="dropdown-menu globaltoc"
       role="menu"
       aria-labelledby="dLabelGlobalToc"><ul>
-<li class="toctree-l1"><a class="reference internal" href="source.html">EV3</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#motor">Motor</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#sensor">Sensor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -125,13 +129,18 @@
  | <a href="#C"><strong>C</strong></a>
  | <a href="#D"><strong>D</strong></a>
  | <a href="#E"><strong>E</strong></a>
+ | <a href="#G"><strong>G</strong></a>
+ | <a href="#H"><strong>H</strong></a>
  | <a href="#I"><strong>I</strong></a>
  | <a href="#L"><strong>L</strong></a>
  | <a href="#M"><strong>M</strong></a>
+ | <a href="#N"><strong>N</strong></a>
+ | <a href="#O"><strong>O</strong></a>
  | <a href="#P"><strong>P</strong></a>
  | <a href="#R"><strong>R</strong></a>
  | <a href="#S"><strong>S</strong></a>
  | <a href="#T"><strong>T</strong></a>
+ | <a href="#U"><strong>U</strong></a>
  | <a href="#V"><strong>V</strong></a>
  | <a href="#W"><strong>W</strong></a>
  
@@ -140,21 +149,29 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.batteryMode">batteryMode (source.EV3 attribute)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.backend">backend (source.btBrickIO attribute)</a>
+  </dt>
+
+      
+  <dt><a href="EV3.html#source.EV3.batteryMode">batteryMode (source.EV3 attribute)</a>, <a href="source.html#source.EV3.batteryMode">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.batteryValue">batteryValue (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.batteryValue">batteryValue (source.EV3 attribute)</a>, <a href="source.html#source.EV3.batteryValue">[1]</a>
   </dt>
 
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.beep">beep() (source.EV3 method)</a>
+  <dt><a href="EV3.html#source.EV3.beep">beep() (source.EV3 method)</a>, <a href="source.html#source.EV3.beep">[1]</a>
+  </dt>
+
+      
+  <dt><a href="Motor.html#source.Motor.brakeMode">brakeMode (source.Motor attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.brakeMode">brakeMode (source.Motor attribute)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO">btBrickIO (class in source)</a>
   </dt>
 
   </dl></td>
@@ -164,13 +181,31 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.connect">connect() (source.EV3 method)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.channel">channel (source.btBrickIO attribute)</a>
+  </dt>
+
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.close">close() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.close">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.close">(source.usbBrickIO method)</a>
   </dt>
 
+      </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.currentSpeed">currentSpeed (source.Motor attribute)</a>
+  <dt><a href="EV3.html#source.EV3.connect">connect() (source.EV3 method)</a>, <a href="source.html#source.EV3.connect">[1]</a>
+  </dt>
+
+      
+  <dt><a href="Motor.html#source.Motor.currentSpeed">currentSpeed (source.Motor attribute)</a>
   </dt>
 
   </dl></td>
@@ -180,23 +215,35 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.debug">debug (source.EV3 attribute)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.debug">debug (source.btBrickIO attribute)</a>
   </dt>
 
       <dd><dl>
         
-  <dt><a href="source.html#source.Motor.debug">(source.Motor attribute)</a>
+  <dt><a href="EV3.html#source.EV3.debug">(source.EV3 attribute)</a>, <a href="source.html#source.EV3.debug">[1]</a>
+  </dt>
+
+        
+  <dt><a href="Motor.html#source.Motor.debug">(source.Motor attribute)</a>
   </dt>
 
         
-  <dt><a href="source.html#source.Sensor.debug">(source.Sensor attribute)</a>
+  <dt><a href="Sensor.html#source.Sensor.debug">(source.Sensor attribute)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.debug">(source.usbBrickIO attribute)</a>
   </dt>
 
       </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.disconnect">disconnect() (source.EV3 method)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.deviceName">deviceName (source.btBrickIO attribute)</a>
+  </dt>
+
+      
+  <dt><a href="EV3.html#source.EV3.disconnect">disconnect() (source.EV3 method)</a>, <a href="source.html#source.EV3.disconnect">[1]</a>
   </dt>
 
   </dl></td>
@@ -206,7 +253,61 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3">EV3 (class in source)</a>
+  <dt><a href="hid.html#source.hidapi.enumerate">enumerate() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.error">error() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="EV3.html#source.EV3">EV3 (class in source)</a>, <a href="source.html#source.EV3">[1]</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.exit">exit() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+</tr></table>
+
+<h2 id="G">G</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.getHIDInfoString">getHIDInfoString() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.getManufacturersString">getManufacturersString() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.getProductString">getProductString() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.getSerialNumberString">getSerialNumberString() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+</tr></table>
+
+<h2 id="H">H</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.handle">handle (source.hidapi attribute)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi">hidapi (class in source)</a>
   </dt>
 
   </dl></td>
@@ -216,17 +317,21 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.internalReset">internalReset() (source.Motor method)</a>
+  <dt><a href="hid.html#source.hidapi.init">init() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="Motor.html#source.Motor.internalReset">internalReset() (source.Motor method)</a>
   </dt>
 
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.isConnected">isConnected (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.isConnected">isConnected (source.EV3 attribute)</a>, <a href="source.html#source.EV3.isConnected">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.isRunning">isRunning (source.Motor attribute)</a>
+  <dt><a href="Motor.html#source.Motor.isRunning">isRunning (source.Motor attribute)</a>
   </dt>
 
   </dl></td>
@@ -236,13 +341,13 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.limitMode">limitMode (source.Motor attribute)</a>
+  <dt><a href="Motor.html#source.Motor.limitMode">limitMode (source.Motor attribute)</a>
   </dt>
 
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.limitValue">limitValue (source.Motor attribute)</a>
+  <dt><a href="Motor.html#source.Motor.limitValue">limitValue (source.Motor attribute)</a>
   </dt>
 
   </dl></td>
@@ -252,47 +357,105 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Sensor.mode">mode (source.Sensor attribute)</a>
+  <dt><a href="Sensor.html#source.Sensor.mode">mode (source.Sensor attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor">Motor (class in source)</a>
+  <dt><a href="Motor.html#source.Motor">Motor (class in source)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.motorA">motorA (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.motorA">motorA (source.EV3 attribute)</a>, <a href="source.html#source.EV3.motorA">[1]</a>
   </dt>
 
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.motorB">motorB (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.motorB">motorB (source.EV3 attribute)</a>, <a href="source.html#source.EV3.motorB">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.motorC">motorC (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.motorC">motorC (source.EV3 attribute)</a>, <a href="source.html#source.EV3.motorC">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.motorD">motorD (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.motorD">motorD (source.EV3 attribute)</a>, <a href="source.html#source.EV3.motorD">[1]</a>
   </dt>
 
   </dl></td>
 </tr></table>
 
+<h2 id="N">N</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.nReadBuffer">nReadBuffer (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.nReadBuffer">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.nWriteBuffer">nWriteBuffer (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.nWriteBuffer">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
+</tr></table>
+
+<h2 id="O">O</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.open">open() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.open">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.open">(source.usbBrickIO method)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
+</tr></table>
+
 <h2 id="P">P</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.EV3.playTone">playTone() (source.EV3 method)</a>
+  <dt><a href="EV3.html#source.EV3.playTone">playTone() (source.EV3 method)</a>, <a href="source.html#source.EV3.playTone">[1]</a>
+  </dt>
+
+      
+  <dt><a href="Motor.html#source.Motor.power">power (source.Motor attribute)</a>
   </dt>
 
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.power">power (source.Motor attribute)</a>
+  <dt><a href="hid.html#source.hidapi.productID">productID (source.hidapi attribute)</a>
   </dt>
 
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.productID">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
   </dl></td>
 </tr></table>
 
@@ -300,13 +463,31 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Sensor.reset">reset() (source.Sensor method)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.read">read() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.read">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.read">(source.usbBrickIO method)</a>
   </dt>
 
+      </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.resetTachoCount">resetTachoCount() (source.Motor method)</a>
+  <dt><a href="hid.html#source.hidapi.read_timeout">read_timeout() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="Sensor.html#source.Sensor.reset">reset() (source.Sensor method)</a>
+  </dt>
+
+      
+  <dt><a href="Motor.html#source.Motor.resetTachoCount">resetTachoCount() (source.Motor method)</a>
   </dt>
 
   </dl></td>
@@ -316,83 +497,103 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Sensor">Sensor (class in source)</a>
+  <dt><a href="Sensor.html#source.Sensor">Sensor (class in source)</a>
+  </dt>
+
+      
+  <dt><a href="EV3.html#source.EV3.sensor1">sensor1 (source.EV3 attribute)</a>, <a href="source.html#source.EV3.sensor1">[1]</a>
+  </dt>
+
+      
+  <dt><a href="EV3.html#source.EV3.sensor2">sensor2 (source.EV3 attribute)</a>, <a href="source.html#source.EV3.sensor2">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.sensor1">sensor1 (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.sensor3">sensor3 (source.EV3 attribute)</a>, <a href="source.html#source.EV3.sensor3">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.sensor2">sensor2 (source.EV3 attribute)</a>
+  <dt><a href="EV3.html#source.EV3.sensor4">sensor4 (source.EV3 attribute)</a>, <a href="source.html#source.EV3.sensor4">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.sensor3">sensor3 (source.EV3 attribute)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.serialPort">serialPort (source.btBrickIO attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.sensor4">sensor4 (source.EV3 attribute)</a>
+  <dt><a href="Motor.html#source.Motor.setBrake">setBrake() (source.Motor method)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.setBrake">setBrake() (source.Motor method)</a>
+  <dt><a href="hid.html#source.hidapi.setNonBlocking">setNonBlocking() (source.hidapi method)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.setProperties">setProperties() (source.EV3 method)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.setProperties">setProperties() (source.btBrickIO method)</a>
   </dt>
 
       <dd><dl>
         
-  <dt><a href="source.html#source.Motor.setProperties">(source.Motor method)</a>
+  <dt><a href="EV3.html#source.EV3.setProperties">(source.EV3 method)</a>, <a href="source.html#source.EV3.setProperties">[1]</a>
+  </dt>
+
+        
+  <dt><a href="Motor.html#source.Motor.setProperties">(source.Motor method)</a>
+  </dt>
+
+        
+  <dt><a href="Sensor.html#source.Sensor.setProperties">(source.Sensor method)</a>
   </dt>
 
         
-  <dt><a href="source.html#source.Sensor.setProperties">(source.Sensor method)</a>
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.setProperties">(source.usbBrickIO method)</a>
   </dt>
 
       </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.smoothStart">smoothStart (source.Motor attribute)</a>
+  <dt><a href="hid.html#source.hidapi.sheader">sheader (source.hidapi attribute)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.slib">slib (source.hidapi attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.smoothStop">smoothStop (source.Motor attribute)</a>
+  <dt><a href="Motor.html#source.Motor.smoothStart">smoothStart (source.Motor attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#module-source">source (module)</a>
+  <dt><a href="Motor.html#source.Motor.smoothStop">smoothStop (source.Motor attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.speedRegulation">speedRegulation (source.Motor attribute)</a>
+  <dt><a href="CommandLayer.html#module-source">source (module)</a>, <a href="CommunicationLayer.html#module-source">[1]</a>, <a href="EV3.html#module-source">[2]</a>, <a href="Motor.html#module-source">[3]</a>, <a href="Sensor.html#module-source">[4]</a>, <a href="btBrickIO.html#module-source">[5]</a>, <a href="hid.html#module-source">[6]</a>, <a href="source.html#module-source">[7]</a>, <a href="usbBrickIO.html#module-source">[8]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.start">start() (source.Motor method)</a>
+  <dt><a href="Motor.html#source.Motor.speedRegulation">speedRegulation (source.Motor attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.stop">stop() (source.Motor method)</a>
+  <dt><a href="Motor.html#source.Motor.start">start() (source.Motor method)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.stopAllMotors">stopAllMotors() (source.EV3 method)</a>
+  <dt><a href="Motor.html#source.Motor.stop">stop() (source.Motor method)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.stopTone">stopTone() (source.EV3 method)</a>
+  <dt><a href="EV3.html#source.EV3.stopTone">stopTone() (source.EV3 method)</a>, <a href="source.html#source.EV3.stopTone">[1]</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.syncedStart">syncedStart() (source.Motor method)</a>
+  <dt><a href="Motor.html#source.Motor.syncedStart">syncedStart() (source.Motor method)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.Motor.syncedStop">syncedStop() (source.Motor method)</a>
+  <dt><a href="Motor.html#source.Motor.syncedStop">syncedStop() (source.Motor method)</a>
   </dt>
 
   </dl></td>
@@ -402,35 +603,67 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.tachoCount">tachoCount (source.Motor attribute)</a>
+  <dt><a href="Motor.html#source.Motor.tachoCount">tachoCount (source.Motor attribute)</a>
   </dt>
 
       
-  <dt><a href="source.html#source.EV3.tonePlayed">tonePlayed() (source.EV3 method)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.timeOut">timeOut (source.btBrickIO attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.timeOut">(source.usbBrickIO attribute)</a>
   </dt>
 
+      </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.type">type (source.Motor attribute)</a>
+  <dt><a href="EV3.html#source.EV3.tonePlayed">tonePlayed() (source.EV3 method)</a>, <a href="source.html#source.EV3.tonePlayed">[1]</a>
+  </dt>
+
+      
+  <dt><a href="Motor.html#source.Motor.type">type (source.Motor attribute)</a>
   </dt>
 
       <dd><dl>
         
-  <dt><a href="source.html#source.Sensor.type">(source.Sensor attribute)</a>
+  <dt><a href="Sensor.html#source.Sensor.type">(source.Sensor attribute)</a>
   </dt>
 
       </dl></dd>
   </dl></td>
 </tr></table>
 
+<h2 id="U">U</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="usbBrickIO.html#source.usbBrickIO">usbBrickIO (class in source)</a>
+  </dt>
+
+  </dl></td>
+</tr></table>
+
 <h2 id="V">V</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Sensor.value">value (source.Sensor attribute)</a>
+  <dt><a href="Sensor.html#source.Sensor.value">value (source.Sensor attribute)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.vendorID">vendorID (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.vendorID">(source.usbBrickIO attribute)</a>
   </dt>
 
+      </dl></dd>
   </dl></td>
 </tr></table>
 
@@ -438,9 +671,23 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="source.html#source.Motor.waitFor">waitFor() (source.Motor method)</a>
+  <dt><a href="Motor.html#source.Motor.waitFor">waitFor() (source.Motor method)</a>
   </dt>
 
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.write">write() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.write">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.write">(source.usbBrickIO method)</a>
+  </dt>
+
+      </dl></dd>
   </dl></td>
 </tr></table>
 
@@ -457,7 +704,7 @@
       
     </p>
     <p>
-        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
     </p>
   </div>
diff --git a/docs/_build/html/hid.html b/docs/_build/html/hid.html
new file mode 100644
index 0000000000000000000000000000000000000000..9b1866a66beca190d56e05d9db2b9187b4a40d39
--- /dev/null
+++ b/docs/_build/html/hid.html
@@ -0,0 +1,461 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>hidapi &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+    <link rel="next" title="usbBrickIO" href="usbBrickIO.html" />
+    <link rel="prev" title="Sensor" href="Sensor.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">hidapi</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="Sensor.html" title="Previous Chapter: Sensor"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Sensor</span>
+    </a>
+  </li>
+  <li>
+    <a href="usbBrickIO.html" title="Next Chapter: usbBrickIO"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">usbBrickIO &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/hid.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="hidapi">
+<h1>hidapi<a class="headerlink" href="#hidapi" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.hidapi">
+<em class="property">class </em><code class="descclassname">source.</code><code class="descname">hidapi</code><span class="sig-paren">(</span><em>vendorID</em>, <em>productID</em>, <em>nReadBuffer</em>, <em>nWriteBuffer</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.hidapi.open" title="source.hidapi.open"><code class="xref mat mat-meth docutils literal"><span class="pre">open()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.close" title="source.hidapi.close"><code class="xref mat mat-meth docutils literal"><span class="pre">close()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.read" title="source.hidapi.read"><code class="xref mat mat-meth docutils literal"><span class="pre">read()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.read_timeout" title="source.hidapi.read_timeout"><code class="xref mat mat-meth docutils literal"><span class="pre">read_timeout()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.write" title="source.hidapi.write"><code class="xref mat mat-meth docutils literal"><span class="pre">write()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getHIDInfoString" title="source.hidapi.getHIDInfoString"><code class="xref mat mat-meth docutils literal"><span class="pre">getHIDInfoString()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.setNonBlocking" title="source.hidapi.setNonBlocking"><code class="xref mat mat-meth docutils literal"><span class="pre">setNonBlocking()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.init" title="source.hidapi.init"><code class="xref mat mat-meth docutils literal"><span class="pre">init()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.exit" title="source.hidapi.exit"><code class="xref mat mat-meth docutils literal"><span class="pre">exit()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.error" title="source.hidapi.error"><code class="xref mat mat-meth docutils literal"><span class="pre">error()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.enumerate" title="source.hidapi.enumerate"><code class="xref mat mat-meth docutils literal"><span class="pre">enumerate()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getManufacturersString" title="source.hidapi.getManufacturersString"><code class="xref mat mat-meth docutils literal"><span class="pre">getManufacturersString()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getProductString" title="source.hidapi.getProductString"><code class="xref mat mat-meth docutils literal"><span class="pre">getProductString()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getSerialNumberString" title="source.hidapi.getSerialNumberString"><code class="xref mat mat-meth docutils literal"><span class="pre">getSerialNumberString()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>Interface to the hidapi library</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Developed from the hidapi available at <a class="reference external" href="http://www.signal11.us/oss/hidapi/">http://www.signal11.us/oss/hidapi/</a>.</li>
+<li>Windows: hidapi.dll needed.</li>
+<li>Mac: hidapi.dylib needed. In addition, Xcode has to be installed.</li>
+<li>Linux: hidapi has to be compiled on host-system.</li>
+</ul>
+<dl class="attribute">
+<dt id="source.hidapi.handle">
+<code class="descname">handle</code><a class="headerlink" href="#source.hidapi.handle" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.vendorID">
+<code class="descname">vendorID</code><a class="headerlink" href="#source.hidapi.vendorID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Vendor-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.productID">
+<code class="descname">productID</code><a class="headerlink" href="#source.hidapi.productID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Product-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nReadBuffer">
+<code class="descname">nReadBuffer</code><a class="headerlink" href="#source.hidapi.nReadBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Read-buffer size in bytes.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nWriteBuffer">
+<code class="descname">nWriteBuffer</code><a class="headerlink" href="#source.hidapi.nWriteBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.slib">
+<code class="descname">slib</code><a class="headerlink" href="#source.hidapi.slib" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library file (without file extension). Defaults to
+&#8216;hidapi&#8217;.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.sheader">
+<code class="descname">sheader</code><a class="headerlink" href="#source.hidapi.sheader" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library header. Defaults to &#8216;hidapi.h&#8217;.</p>
+</dd></dl>
+
+<p class="rubric">Example</p>
+<p>hidHandle = hidapi(1684,0005,1024,1025); %|br|</p>
+<dl class="method">
+<dt id="source.hidapi.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Close the connection to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when deleting the hidapi instance.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.enumerate">
+<code class="descname">enumerate</code><span class="sig-paren">(</span><em>hid</em>, <em>vendorID</em>, <em>productID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.enumerate" title="Permalink to this definition">¶</a></dt>
+<dd><p>Enumerates the info about the hid device with the given vendorID and productID
+and returns a string with the returned hid information.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>vendorID</strong> (<em>numeric</em>) &#8211; Vendor-ID of the USB device in decimal.</li>
+<li><strong>productID</strong> (<em>numeric</em>) &#8211; Product-ID of the USB device in decimal.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Using a vendorID and productID of (0,0) will enumerate all connected hid
+devices.</li>
+<li>MATLAB does not have the hid_device_infoPtr struct so some of the returned
+information will need to be resized and cast into uint8 or chars.</li>
+</ul>
+<p>Enumerate the hid devices</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.error">
+<code class="descname">error</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.error" title="Permalink to this definition">¶</a></dt>
+<dd><p>Return the hid device error string if a function produced an error.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This function must be called explicitly if you think an error was generated
+from the hid device.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.exit">
+<code class="descname">exit</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.exit" title="Permalink to this definition">¶</a></dt>
+<dd><p>hidapi.exit Exit hidapi</p>
+<p>hid.exit() exits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p>Notes::
+- You should not have to call this function directly.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getHIDInfoString">
+<code class="descname">getHIDInfoString</code><span class="sig-paren">(</span><em>hid</em>, <em>info</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getHIDInfoString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the corresponding hid info from the hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Info is the hid information string.</li>
+</ul>
+<p>See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+HIDAPI.GETSERIALNUMBERSTRING.</p>
+<p>Read buffer nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getManufacturersString">
+<code class="descname">getManufacturersString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getManufacturersString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get manufacturers string from hid object using getHIDInfoString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getProductString">
+<code class="descname">getProductString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getProductString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get product string from hid object using getProductString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getSerialNumberString">
+<code class="descname">getSerialNumberString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getSerialNumberString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get serial number from hid object using getSerialNumberString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.init">
+<code class="descname">init</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.init" title="Permalink to this definition">¶</a></dt>
+<dd><p>Inits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This is called automatically in the library itself with the open function. You
+should not have to call this function directly.</li>
+</ul>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Open a connection with a hid device</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when creating an hidapi-object.</li>
+<li>The pointer return value from this library call is always null so it is not
+possible to know if the open was successful.</li>
+<li>The final parameter to the open hidapi library call has different types
+depending on OS. On windows it is uint16, on linux/mac int32.</li>
+</ul>
+<p>Create a null pointer for the hid_open function (depends on OS)</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device and returns the read bytes.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if no data was read.</li>
+</ul>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read_timeout">
+<code class="descname">read_timeout</code><span class="sig-paren">(</span><em>hid</em>, <em>timeOut</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read_timeout" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device with a timeout and return the read bytes.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeOut</strong> (<em>numeric &gt;= 0</em>) &#8211; Milliseconds after which a timeout-error occurs if no
+packet could be read.</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.setNonBlocking">
+<code class="descname">setNonBlocking</code><span class="sig-paren">(</span><em>hid</em>, <em>nonblock</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.setNonBlocking" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set the non blocking flag on the hid device connection.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nonblock</strong> (<em>numeric in {0,1}</em>) &#8211; 0 disables nonblocking, 1 enables nonblocking</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>hid</em>, <em>wmsg</em>, <em>reportID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Write to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if there is a mismatch between the buffer size and the
+reported number of bytes written.</li>
+</ul>
+<p>Append a 0 at the front for HID report ID</p>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html
index 045ce15577b0f1b06ee2be41b928bd3bf1a3da35..deee34728f91dad5957755d30902e7f05813ce7b 100644
--- a/docs/_build/html/index.html
+++ b/docs/_build/html/index.html
@@ -5,18 +5,17 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Toolbox for controlling Lego Mindstorms EV3 with MATLAB &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    <title>MATLAB Toolbox for controlling Lego Mindstorms EV3 &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
     
     <link rel="stylesheet" href="_static/basic.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
     <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
     
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     'v0.4-rc.10',
+        VERSION:     'v1.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -31,8 +30,8 @@
     <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="#" />
-    <link rel="next" title="EV3" href="source.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="#" />
+    <link rel="next" title="EV3" href="EV3.html" />
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
 <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
@@ -52,7 +51,7 @@
         </button>
         <a class="navbar-brand" href="#">
           Mindstorms EV3 Toolbox</a>
-        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
       </div>
 
         <div class="collapse navbar-collapse nav-collapse">
@@ -68,9 +67,14 @@
   <ul class="dropdown-menu globaltoc"
       role="menu"
       aria-labelledby="dLabelGlobalToc"><ul>
-<li class="toctree-l1"><a class="reference internal" href="source.html">EV3</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#motor">Motor</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#sensor">Sensor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -84,8 +88,12 @@
   <ul class="dropdown-menu localtoc"
       role="menu"
       aria-labelledby="dLabelLocalToc"><ul>
-<li><a class="reference internal" href="#">Toolbox for controlling Lego Mindstorms EV3 with MATLAB</a></li>
-<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
+<li><a class="reference internal" href="#">MATLAB Toolbox for controlling Lego Mindstorms EV3</a><ul>
+<li><a class="reference internal" href="#contents">Contents</a><ul>
+</ul>
+</li>
+</ul>
+</li>
 </ul>
 </ul>
 </li>
@@ -95,7 +103,7 @@
               
                 
   <li>
-    <a href="source.html" title="Next Chapter: EV3"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">EV3 &raquo;</span>
+    <a href="EV3.html" title="Next Chapter: EV3"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">EV3 &raquo;</span>
     </a>
   </li>
               
@@ -129,24 +137,30 @@
   <div class="row">
     <div class="col-md-12 content">
       
-  <div class="section" id="toolbox-for-controlling-lego-mindstorms-ev3-with-matlab">
-<h1>Toolbox for controlling Lego Mindstorms EV3 with MATLAB<a class="headerlink" href="#toolbox-for-controlling-lego-mindstorms-ev3-with-matlab" title="Permalink to this headline">¶</a></h1>
-<p>Contents:</p>
+  <div class="section" id="matlab-toolbox-for-controlling-lego-mindstorms-ev3">
+<h1>MATLAB Toolbox for controlling Lego Mindstorms EV3<a class="headerlink" href="#matlab-toolbox-for-controlling-lego-mindstorms-ev3" title="Permalink to this headline">¶</a></h1>
+<p>Hi there! This is the documentation for the &#8220;Lego Mindstorms EV3&#8221; MATLAB Toolbox,
+developed by RWTH Aachen. For an introduction about this toolbox, installation
+guides and examples, take a look at <a class="reference external" href="https://git.rwth-aachen.de/mindstorms/ev3-toolbox-matlab/blob/master/readme.md">our repository</a>.</p>
+<div class="section" id="contents">
+<h2>Contents<a class="headerlink" href="#contents" title="Permalink to this headline">¶</a></h2>
+<p>High-Level documentation</p>
 <div class="toctree-wrapper compound">
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="source.html">EV3</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#motor">Motor</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#sensor">Sensor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 </div>
-</div>
-<div class="section" id="indices-and-tables">
-<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
-<ul class="simple">
-<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
-<li><a class="reference internal" href="mat-modindex.html"><em>Module Index</em></a></li>
-<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
+<p>Low-Level documentation</p>
+<div class="toctree-wrapper compound">
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
+</div>
+</div>
 </div>
 
 
@@ -161,7 +175,7 @@
       
     </p>
     <p>
-        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
     </p>
   </div>
diff --git a/docs/_build/html/mat-modindex.html b/docs/_build/html/mat-modindex.html
index 1860710e5b7ebde5ad31d8827420608dc24cddd9..53f2f5806caa59bee280c86d64261d207298ed59 100644
--- a/docs/_build/html/mat-modindex.html
+++ b/docs/_build/html/mat-modindex.html
@@ -5,18 +5,17 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>MATLAB Module Index &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    <title>MATLAB Module Index &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
     
     <link rel="stylesheet" href="_static/basic.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
     <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
     
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     'v0.4-rc.10',
+        VERSION:     'v1.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -31,7 +30,7 @@
     <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
 
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
@@ -58,7 +57,7 @@
         </button>
         <a class="navbar-brand" href="index.html">
           Mindstorms EV3 Toolbox</a>
-        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
       </div>
 
         <div class="collapse navbar-collapse nav-collapse">
@@ -74,9 +73,14 @@
   <ul class="dropdown-menu globaltoc"
       role="menu"
       aria-labelledby="dLabelGlobalToc"><ul>
-<li class="toctree-l1"><a class="reference internal" href="source.html">EV3</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#motor">Motor</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#sensor">Sensor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -137,7 +141,7 @@
      <tr>
        <td></td>
        <td>
-       <a href="source.html#module-source"><code class="xref">source</code></a></td><td>
+       <a href="usbBrickIO.html#module-source"><code class="xref">source</code></a></td><td>
        <em></em></td></tr>
    </table>
 
@@ -153,7 +157,7 @@
       
     </p>
     <p>
-        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
     </p>
   </div>
diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv
index f9b32ebf05a4d518ca862cb167db59b06156c49c..2761ae6aaad5db7c68b55918bb27c7051d1fe7ad 100644
Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ
diff --git a/docs/_build/html/readme.html b/docs/_build/html/readme.html
new file mode 100644
index 0000000000000000000000000000000000000000..b6b3795d8879125824391be57e026844390674f2
--- /dev/null
+++ b/docs/_build/html/readme.html
@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>General &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">General</a><ul>
+<li><a class="reference internal" href="#installation">Installation</a></li>
+<li><a class="reference internal" href="#contribution">Contribution</a></li>
+<li><a class="reference internal" href="#licenses">Licenses</a></li>
+</ul>
+</li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/readme.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <div class="section" id="general">
+<h1>General<a class="headerlink" href="#general" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="installation">
+<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
+</div>
+<div class="section" id="contribution">
+<h2>Contribution<a class="headerlink" href="#contribution" title="Permalink to this headline">¶</a></h2>
+</div>
+<div class="section" id="licenses">
+<h2>Licenses<a class="headerlink" href="#licenses" title="Permalink to this headline">¶</a></h2>
+</div>
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html
index 57497e3195728c761403578d1ce321e2bd22abee..1adddd4bca3d3676dba91ad0a143c8b3085ae7d2 100644
--- a/docs/_build/html/search.html
+++ b/docs/_build/html/search.html
@@ -5,18 +5,17 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>Search &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    <title>Search &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
     
     <link rel="stylesheet" href="_static/basic.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
     <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
     
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     'v0.4-rc.10',
+        VERSION:     'v1.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -32,7 +31,7 @@
     <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="#" />
-    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
   <script type="text/javascript">
     jQuery(function() { Search.loadIndex("searchindex.js"); });
   </script>
@@ -59,7 +58,7 @@
         </button>
         <a class="navbar-brand" href="index.html">
           Mindstorms EV3 Toolbox</a>
-        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
       </div>
 
         <div class="collapse navbar-collapse nav-collapse">
@@ -75,9 +74,14 @@
   <ul class="dropdown-menu globaltoc"
       role="menu"
       aria-labelledby="dLabelGlobalToc"><ul>
-<li class="toctree-l1"><a class="reference internal" href="source.html">EV3</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#motor">Motor</a></li>
-<li class="toctree-l1"><a class="reference internal" href="source.html#sensor">Sensor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -158,7 +162,7 @@
       
     </p>
     <p>
-        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
     </p>
   </div>
diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js
index 25c11b86f510e7aae182dd3588a9221f9628a14c..f7576ea229c474e5df54d5e6a2efa68342e6765b 100644
--- a/docs/_build/html/searchindex.js
+++ b/docs/_build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({envversion:49,filenames:["index","source"],objects:{"":{source:[1,0,1,""]},"source.EV3":{batteryMode:[1,2,1,""],batteryValue:[1,2,1,""],beep:[1,3,1,""],connect:[1,3,1,""],debug:[1,2,1,""],disconnect:[1,3,1,""],isConnected:[1,2,1,""],motorA:[1,2,1,""],motorB:[1,2,1,""],motorC:[1,2,1,""],motorD:[1,2,1,""],playTone:[1,3,1,""],sensor1:[1,2,1,""],sensor2:[1,2,1,""],sensor3:[1,2,1,""],sensor4:[1,2,1,""],setProperties:[1,3,1,""],stopAllMotors:[1,3,1,""],stopTone:[1,3,1,""],tonePlayed:[1,3,1,""]},"source.Motor":{brakeMode:[1,2,1,""],currentSpeed:[1,2,1,""],debug:[1,2,1,""],internalReset:[1,3,1,""],isRunning:[1,2,1,""],limitMode:[1,2,1,""],limitValue:[1,2,1,""],power:[1,2,1,""],resetTachoCount:[1,3,1,""],setBrake:[1,3,1,""],setProperties:[1,3,1,""],smoothStart:[1,2,1,""],smoothStop:[1,2,1,""],speedRegulation:[1,2,1,""],start:[1,3,1,""],stop:[1,3,1,""],syncedStart:[1,3,1,""],syncedStop:[1,3,1,""],tachoCount:[1,2,1,""],type:[1,2,1,""],waitFor:[1,3,1,""]},"source.Sensor":{debug:[1,2,1,""],mode:[1,2,1,""],reset:[1,3,1,""],setProperties:[1,3,1,""],type:[1,2,1,""],value:[1,2,1,""]},source:{EV3:[1,1,1,""],Motor:[1,1,1,""],Sensor:[1,1,1,""]}},objnames:{"0":["mat","module","MATLAB module"],"1":["mat","class","MATLAB class"],"2":["mat","attribute","MATLAB attribute"],"3":["mat","method","MATLAB method"]},objtypes:{"0":"mat:module","1":"mat:class","2":"mat:attribute","3":"mat:method"},terms:{"5000hz":1,"case":1,"catch":1,"class":1,"default":1,"function":1,"long":1,"return":1,"true":1,"try":1,"while":1,about:1,acceler:1,accelerationallax:1,accident:1,act:1,action:1,actual:1,affect:1,afraid:1,after:1,again:1,all:1,allow:1,alreadi:1,also:1,alternatingli:1,ambient:1,angular:1,ani:1,anoth:1,apply:1,aren:1,around:1,ask:1,automat:1,avail:1,avoid:1,batteri:1,batterymod:1,batterymode:1,batteryvalu:1,been:1,beep:1,befor:1,behav:1,behaviour:1,better:1,bit:1,blue:1,bluetooth:1,bool:1,both:1,brake:1,brakemod:1,brick:1,bug:1,buggi:1,bump:1,c_output:1,call:1,can:1,cannot:1,central:1,chang:1,charg:1,check:1,clear:1,coast:1,code:1,col:1,color:1,com:1,comm:1,command:1,comment:1,commun:1,confus:1,connect:1,connectiontyp:1,consist:1,consol:1,constantli:1,content:0,continu:1,conveni:1,correctli:1,count:1,counter:1,cours:1,creat:1,current:1,currentspe:1,dba:1,debug:1,defin:1,degre:1,delet:1,deliber:1,deliv:1,depend:1,descript:[],desir:1,destroi:1,dev:1,devic:1,devicemod:1,devicetyp:1,differ:1,direct:1,disconnect:1,distcm:1,distin:1,doe:1,doesn:1,don:1,done:1,down:1,durat:1,each:1,eas:1,effect:1,either:1,enabl:1,equal:1,error:1,establish:1,even:1,everytim:1,exampl:1,excerpt:1,execut:1,exit:1,expect:1,facilit:1,fals:1,far:1,feedback:1,finish:1,firmwar:1,first:1,follow:1,forward:1,four:1,frequenc:1,from:1,fun:1,get:1,given:1,glanc:1,goe:1,greater:1,green:1,gyro:1,happen:1,have:1,heavi:1,hertz:1,high:1,highest:1,hold:1,how:1,howev:1,htacceleromet:1,htcolor:1,htcompass:1,hysic:1,immedi:1,index:0,indic:1,individu:1,infinit:1,infrare:1,input:1,inputpars:1,instanc:1,instead:1,interfac:1,intern:1,internalreset:1,interpret:1,isconnect:1,isrun:1,iter:1,itself:1,keep:1,kind:1,know:1,largemotor:1,last:1,later:1,layer:1,lead:1,left:1,less:1,level:1,like:1,limit:1,limitmod:1,limitvalu:1,listen:1,load:1,loop:1,low:1,lower:1,mai:1,mainli:1,make:1,manual:1,master:1,mean:1,mediummotor:1,messag:1,method:1,millisecond:1,mind:1,mode:1,modul:0,mostli:1,motor:[],motora:1,motorb:1,motorc:1,motord:1,move:1,multipl:1,name:1,necessari:1,need:1,neg:1,newpag:[],none:1,note:1,now:1,numer:1,nxtcolor:1,nxtlight:1,nxtsound:1,nxttemperatur:1,nxttouch:1,nxtultrason:1,object:1,off:1,old:1,onc:1,once:1,onli:1,only:1,opcod:1,opposit:1,optional:1,other:1,otherwis:1,output:1,outputreadi:1,outputtest:1,packet:1,page:0,paramet:1,pass:1,path:1,paus:1,percent:1,percentag:1,physic:1,plai:1,playton:1,point:1,poll:1,port:1,posit:1,possibl:1,power:1,pretti:1,previous:1,print:1,probabl:1,program:1,properti:1,prox:1,pull:1,push:1,rais:1,rate:1,ratio:1,raw:1,reach:1,read:1,realli:1,reason:1,receiv:1,red:1,reflect:1,regul:1,releas:1,remot:1,repli:1,repres:1,request:1,reset:1,resetposit:1,resettachocount:1,respect:1,respons:1,result:1,rfcomm0:1,rfcomm1:1,rfcomm2:1,right:1,run:1,same:1,search:0,second:1,secur:1,see:1,seek:1,seem:1,send:1,sensor1:1,sensor2:1,sensor3:1,sensor4:1,sensor:[],sent:1,serial:1,serport:1,set:1,setbrak:1,setpow:1,setproperti:1,setup:1,should:1,slave:1,slow:1,slowli:1,smoothli:1,smoothstart:1,smoothstop:1,some:1,sometim:1,somewhat:1,soon:1,sooner:1,sourc:1,special:1,specifi:1,speed:1,speedregul:1,spin:1,start:1,state:1,statu:1,still:1,stop:1,stopallmotor:1,stopton:1,straight:1,string:1,stuff:1,sublay:1,suppos:1,sync:1,syncedstart:1,syncedstop:1,synchron:1,syncmotor:1,tacho:1,tachocount:1,tacholimit:1,take:1,test:1,than:1,them:1,thi:1,thoroughli:1,tight:1,time:1,timeout:1,tone:1,toneplai:1,too:1,touch:1,tricki:1,turn:1,turn_ratio:[],turnratio:1,type:1,ultrason:1,undefin:1,unexpect:1,unknown:1,until:1,usb:1,use:1,user:1,valu:1,varargin:1,via:1,view:1,virtual:1,voltag:1,volum:1,waitfor:1,want:1,wast:1,weird:1,what:1,whatev:1,when:1,which:1,white:1,without:1,work:1,workaround:1,would:1,wrap:1,writable:1,wrong:1,yet:1,you:1,zero:1},titles:["Toolbox for controlling Lego Mindstorms EV3 with MATLAB","EV3"],titleterms:{control:0,ev3:[0,1],indice:0,lego:0,matlab:0,mindstorm:0,motor:1,sensor:1,tabl:0,toolbox:0}})
\ No newline at end of file
+Search.setIndex({envversion:49,filenames:["CommandLayer","CommunicationLayer","EV3","Motor","Sensor","btBrickIO","examples","hid","index","readme","source","usbBrickIO"],objects:{"":{source:[11,0,1,""]},"source.EV3":{batteryMode:[10,2,1,""],batteryValue:[10,2,1,""],beep:[10,3,1,""],connect:[10,3,1,""],debug:[10,2,1,""],disconnect:[10,3,1,""],isConnected:[10,2,1,""],motorA:[10,2,1,""],motorB:[10,2,1,""],motorC:[10,2,1,""],motorD:[10,2,1,""],playTone:[10,3,1,""],sensor1:[10,2,1,""],sensor2:[10,2,1,""],sensor3:[10,2,1,""],sensor4:[10,2,1,""],setProperties:[10,3,1,""],stopTone:[10,3,1,""],tonePlayed:[10,3,1,""]},"source.Motor":{brakeMode:[3,2,1,""],currentSpeed:[3,2,1,""],debug:[3,2,1,""],internalReset:[3,3,1,""],isRunning:[3,2,1,""],limitMode:[3,2,1,""],limitValue:[3,2,1,""],power:[3,2,1,""],resetTachoCount:[3,3,1,""],setBrake:[3,3,1,""],setProperties:[3,3,1,""],smoothStart:[3,2,1,""],smoothStop:[3,2,1,""],speedRegulation:[3,2,1,""],start:[3,3,1,""],stop:[3,3,1,""],syncedStart:[3,3,1,""],syncedStop:[3,3,1,""],tachoCount:[3,2,1,""],type:[3,2,1,""],waitFor:[3,3,1,""]},"source.Sensor":{debug:[4,2,1,""],mode:[4,2,1,""],reset:[4,3,1,""],setProperties:[4,3,1,""],type:[4,2,1,""],value:[4,2,1,""]},"source.btBrickIO":{backend:[5,2,1,""],channel:[5,2,1,""],close:[5,3,1,""],debug:[5,2,1,""],deviceName:[5,2,1,""],open:[5,3,1,""],read:[5,3,1,""],serialPort:[5,2,1,""],setProperties:[5,3,1,""],timeOut:[5,2,1,""],write:[5,3,1,""]},"source.hidapi":{close:[7,3,1,""],enumerate:[7,3,1,""],error:[7,3,1,""],exit:[7,3,1,""],getHIDInfoString:[7,3,1,""],getManufacturersString:[7,3,1,""],getProductString:[7,3,1,""],getSerialNumberString:[7,3,1,""],handle:[7,2,1,""],init:[7,3,1,""],nReadBuffer:[7,2,1,""],nWriteBuffer:[7,2,1,""],open:[7,3,1,""],productID:[7,2,1,""],read:[7,3,1,""],read_timeout:[7,3,1,""],setNonBlocking:[7,3,1,""],sheader:[7,2,1,""],slib:[7,2,1,""],vendorID:[7,2,1,""],write:[7,3,1,""]},"source.usbBrickIO":{close:[11,3,1,""],debug:[11,2,1,""],nReadBuffer:[11,2,1,""],nWriteBuffer:[11,2,1,""],open:[11,3,1,""],productID:[11,2,1,""],read:[11,3,1,""],setProperties:[11,3,1,""],timeOut:[11,2,1,""],vendorID:[11,2,1,""],write:[11,3,1,""]},source:{EV3:[10,1,1,""],Motor:[3,1,1,""],Sensor:[4,1,1,""],btBrickIO:[5,1,1,""],hidapi:[7,1,1,""],usbBrickIO:[11,1,1,""]}},objnames:{"0":["mat","module","MATLAB module"],"1":["mat","class","MATLAB class"],"2":["mat","attribute","MATLAB attribute"],"3":["mat","method","MATLAB method"]},objtypes:{"0":"mat:module","1":"mat:class","2":"mat:attribute","3":"mat:method"},terms:{"0x0005":11,"0x694":11,"2nd":[2,3,4,10],"5000hz":[2,10],"abstract":[],"byte":[7,11],"case":[3,11],"catch":[2,3,10],"char":7,"class":[2,3,4,5,7,10,11],"default":[4,5,7,11],"final":7,"function":[3,7],"long":3,"null":7,"return":[2,3,5,7,10,11],"throw":7,"true":[2,3,5,10,11],"try":[3,5,11],"while":[],aachen:8,abl:[],abort:[2,10],about:[2,3,4,7,8,10],acceler:[3,4],accelerationallax:4,access:[],accident:[2,10],act:3,action:3,actual:[3,7,11],addit:7,advanc:[],affect:3,after:[3,5,7,11],afterward:3,again:3,all:[3,4,7,11],allow:4,alreadi:7,also:[2,3,4,5,7,10,11],alternatingli:[],alwai:[7,11],ambient:4,angular:4,ani:[3,11],announc:[2,3,4,10],anoth:3,append:7,apply:3,aren:3,argument:[2,3,4,10],around:3,arrai:[5,11],automat:[2,3,4,5,7,10],avail:7,backend:5,base:5,batteri:[2,10],batterymod:[2,3,10],batterymode:[2,10],batteryvalu:[2,10],been:[2,3,4,5,10],beep:[2,6,10],befor:5,behav:3,behaviour:[],besid:11,better:3,between:[3,5,7,11],bigger:[7,11],bit:3,block:7,blue:4,bool:[2,3,4,5,10,11],both:3,brake:3,brakemod:3,brakemode:3,brick:[2,3,4,5,10,11],brickio:[5,11],brickobject:[2,3,4,10],buffer:[7,11],buggi:[],building:[],bump:4,c_output:3,call:[2,3,4,5,7,10,11],can:[3,4,5],car:3,cast:7,central:[2,10],chang:3,channel:5,charg:[2,10],check:[3,7],chosen:5,clear:[],close:[5,7,11],coast:3,code:[],col:4,color:4,com:[2,10],comm:[],comment:3,commerror:7,commhandl:[5,11],commun:[3,4,7],compil:7,connect:[2,3,4,5,6,7,10,11],connectiontyp:[2,10],consist:[3,4],consol:[2,3,4,5,10,11],constantli:3,constructor:11,contain:[2,3,4,10],continu:3,contribut:[],control:[],conveni:[2,10],cord:[2,10],correctli:3,correspond:7,could:[5,7,11],count:3,counter:3,cours:3,creat:[2,3,4,7,10],current:[2,3,4,10],currentspe:3,data:[5,7,11],dba:4,debug:[2,3,4,5,10,11],decim:7,defin:3,degre:[3,4],delet:[2,6,7,10],deliv:[2,10],depend:[2,3,4,5,7,10],design:[],destroi:[2,10],dev:[2,3,4,5,10],develop:[7,8],devic:[3,5,7,11],devicemod:4,devicenam:5,devicename:5,devicetyp:[3,4],differ:[2,7,10],direct:3,directli:7,disabl:7,disconnect:[2,10],disp:[2,6,10],distcm:4,distin:4,dll:7,document:8,documentation:[],doe:[2,3,7,10,11],doesn:[],don:[3,4],done:3,down:3,durat:[2,10],dure:7,dylib:7,each:[2,3,4,5,10,11],eas:3,easili:[],either:[2,3,10],enabl:[2,7,10,11],enumer:7,equal:[2,3,10],error:[2,3,4,5,7,10,11],establish:[2,10],even:3,eventu:11,everytim:[3,4],exampl:[],execut:3,exit:7,expect:[2,4,6,10],explicitli:7,extens:7,facilit:4,fail:[2,10],fals:[3,5,11],far:3,fclose:5,feedback:[2,3,4,10],file:7,finish:3,firmwar:[2,3,10],first:[2,3,10],flag:7,follow:[2,3,4,5,10,11],fopen:5,format:[5,11],forward:3,four:3,fread:5,frequenc:[2,10],from:[2,3,4,5,7,10,11],front:7,fun:[2,6,10],fwrite:5,gener:[],germani:[],get:[2,3,7,10],gethidinfostr:7,getmanufacturersstr:7,getmanufacturersstring:7,getproductstr:7,getproductstring:7,getserialnumberstr:7,getserialnumberstring:7,given:[2,3,4,7,10],glanc:[2,10],goe:3,greater:3,green:4,guid:8,gyro:4,handl:7,happen:3,have:[2,3,7,10],header:7,heavi:3,henc:5,here:3,hertz:[2,10],hid:[7,11],hid_device_infoptr:7,hid_open:7,hidapi:[],hidhandl:7,high:[2,3,4,8,10],highest:3,hold:3,host:[5,7],how:3,htacceleromet:4,htcolor:4,htcompass:4,http:7,hysic:4,imag:[],immedi:[2,3,10],implement:[5,11],indic:3,individu:[3,4],infinit:3,info:7,inform:[5,7],infrare:4,init:7,input:[2,3,4,10],inputpars:[2,3,4,5,10,11],instal:[7,8],installat:[],instanc:[3,4,7],instantan:[2,10],instead:[2,3,4,10],instruct:[],instrument:5,instrumentcontrol:5,int32:7,interfac:[2,5,7,10,11],intern:3,internalreset:3,interpret:3,introduct:8,intuit:[],invalid:7,invalidhandl:7,isconnect:[2,10],isconnected:[2,10],isrun:3,iter:[],itself:7,keep:3,kind:3,know:7,lab:[],largemotor:4,last:3,later:[],layer:[3,4],lead:[],left:3,length:7,less:3,level:[2,3,4,8,10],librari:[7,11],licens:[],like:3,limit:3,limitmod:3,limitvalu:[2,3,6,10],linux:[5,7],list:[2,3,4,5,7,10,11],listen:4,load:3,look:8,loop:3,low:[2,8,10],lower:3,mac:[5,7],made:5,mai:[2,3,4,10],mainli:4,make:3,manufactur:7,mark:[2,3,4,10],master:3,matlab:[],maximum:11,mean:3,mediummotor:4,meet:[],messag:3,meth:[],method:[2,3,4,5,7,10,11],millisecond:[2,3,7,10,11],mind:3,mismatch:7,mode:[2,3,4,10],modul:5,mostli:3,motor:[],motora:[2,3,4,6,10],motorb:[2,3,10],motorc:[2,10],motord:[2,10],move:3,multipl:[2,3,4,5,10,11],must:7,myev3:5,name:[2,3,4,5,7,10],nearli:11,necessari:[2,10],need:[2,3,4,5,7,10,11],neg:3,next:3,non:7,nonblock:7,none:4,note:[2,3,4,5,7,10,11],noth:[2,10],now:[2,10],nreadbuff:[7,11],nreadbuffer:11,number:7,numer:[2,3,4,5,7,10,11],nwritebuff:[7,11],nwritebuffer:11,nxt:[],nxtcolor:4,nxtlight:4,nxtsound:4,nxttemperatur:4,nxttouch:4,nxtultrason:4,object:[2,3,4,5,7,10],occur:[5,7,11],off:[2,3,4,10],old:[],onc:[2,3,4,5,10,11],once:4,onli:[],only:[2,3,4,5,10],opcod:3,open:[5,7,11],opposit:3,option:[2,3,4,5,10,11],optional:[2,3,4,10],order:[2,10],oss:7,other:3,otherwis:3,our:8,output:[2,10,11],outputreadi:3,outputtest:[],packet:[2,3,5,7,10,11],pair:5,paramet:[2,3,4,5,7,10,11],part:[],pass:[3,4],path:[2,5,10],paus:[2,10],percent:[2,3,10],percentag:[2,3,10],physic:[2,3,4,10],plai:[2,10],playton:[2,10],point:3,pointer:7,poll:3,port:[2,3,4,5,6,10],posit:3,possibl:[3,4,7],potenti:5,power:[2,3,4,6,10],preced:[2,3,4,10],pretti:3,previous:3,print:[2,7,10],probabl:3,produc:7,product:[7,11],productid:[7,11],program:3,properti:[2,3,4,5,10,11],propertyname1:[5,11],propertyname2:[5,11],propertyvalue1:[5,11],propertyvalue2:[5,11],prox:4,pull:[2,3,10],push:4,rais:3,random:[2,6,10],rate:4,ratio:3,raw:4,reach:3,read:[2,3,4,5,7,10,11],read_timeout:7,reason:3,receiv:[2,3,10],red:4,reflect:4,regul:3,regular:3,releas:3,remot:4,repli:3,report:7,reportid:7,repositori:8,repres:[3,4],request:3,reset:[2,3,4,10],resetposit:3,resettachocount:3,resiz:7,respect:3,respons:3,result:3,rfcomm0:[2,3,4,5,10],rfcomm1:[2,10],rfcomm2:[2,10],right:3,robot:3,run:3,rwth:8,same:3,second:[2,5,10],secur:3,see:[2,3,4,5,7,10,11],seek:4,seem:[2,4,10],send:[2,3,10],sensor1:[2,4,6,10],sensor2:[2,10],sensor3:[2,10],sensor4:[2,10],sensor:[],sent:[2,10],serial:[2,5,7,10],serialport:5,serport:[2,3,4,5,10],set:[2,3,4,5,7,10,11],setbrak:3,setnonblock:7,setproperti:[2,3,4,5,6,10,11],setup:[2,10],sever:[],share:7,sheader:7,should:[3,7,11],shown:5,signal11:7,simplifi:[],size:[7,11],slave:3,slib:7,slow:3,slower:3,slowli:3,small:[2,10],smoothli:3,smoothstart:3,smoothstop:3,some:[3,7],sometim:[],somewhat:3,sooner:[],sourc:[2,3,4,5,7,10,11],specifi:[3,4],speed:3,speedregul:3,spin:3,start:[2,3,6,10],state:3,statu:[2,3,10],still:3,stop:[2,3,10],stopallmotor:[2,10],stopton:[2,10],straight:3,string:[2,3,4,5,7,10],struct:7,student:[],stuff:[2,3,10],sublay:[3,4],success:7,suppos:3,sure:5,sync:3,syncedstart:3,syncedstop:3,synchron:3,syncmotor:3,syntax:[2,3,4,5,10,11],system:[5,7],tacho:3,tachocount:3,tacholimit:3,take:[3,8],temp:[],test:[2,3,4,5,10],than:[3,7,11],them:[2,3,4,10],thi:[2,3,4,5,6,7,8,10],think:7,thoroughli:[2,4,10],through:[5,11],time:3,timeout:[3,5,7,11],tone:[2,10],toneplai:[2,10],too:3,toolbox:[],touch:4,tricki:3,turn:[2,3,4,10],turnratio:3,two:3,type:[2,3,4,7,10],uint16:7,uint8:[5,7,11],ultrason:4,und:3,undefin:4,unexpect:[],unexpectedli:7,unknown:4,until:3,usage:5,usbbrickio:[],use:[3,11],user:[2,10],using:7,valid:[5,7,11],valu:[2,3,4,6,7,10],varargin:[2,3,4,5,10,11],variou:[],vendor:[7,11],vendorid:[7,11],version:[],via:[2,3,4,5,10,11],view:[2,10],virtual:[2,10],voltag:[2,3,10],volum:[2,10],wai:[],waitfor:[2,3,6,10],want:[],warn:[],wast:3,weird:3,what:[2,3,4,10],whatev:3,when:[2,3,4,5,7,10,11],which:[2,3,4,5,7,10,11],white:4,window:[5,7],without:[3,7],wmsg:[5,7,11],work:[2,3,4,10,11],workaround:3,would:[2,3,4,10],wrap:[],writable:[2,3,4,10],write:[5,7,11],written:[5,7,11],wrong:[2,10],www:7,xcode:7,yet:[2,10],you:[3,4,7,11],your:[]},titles:["CommandLayer","CommunicationLayer","EV3","Motor","Sensor","btBrickIO","Examples","hidapi","MATLAB Toolbox for controlling Lego Mindstorms EV3","General","EV3","usbBrickIO"],titleterms:{bluetooth:1,btbrickio:5,command:0,commandlay:0,communicationinterfac:0,communicationlay:1,content:8,contribut:9,control:8,ev3:[2,8,10],exampl:6,gener:9,hidapi:7,installat:9,lego:8,licens:9,matlab:8,mindstorm:8,motor:3,sensor:4,toolbox:8,usb:1,usbbrickio:11}})
\ No newline at end of file
diff --git a/docs/_build/html/source.html b/docs/_build/html/source.html
index d43afef569295adabaf396a099f598e0b33e569e..9e6a5daafacf07d6192add5e0ea9911e57885f44 100644
--- a/docs/_build/html/source.html
+++ b/docs/_build/html/source.html
@@ -5,18 +5,17 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
-    <title>EV3 &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    <title>EV3 &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
     
     <link rel="stylesheet" href="_static/basic.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
-    <link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
     <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
     
     <script type="text/javascript">
       var DOCUMENTATION_OPTIONS = {
         URL_ROOT:    './',
-        VERSION:     'v0.4-rc.10',
+        VERSION:     'v1.0',
         COLLAPSE_INDEX: false,
         FILE_SUFFIX: '.html',
         HAS_SOURCE:  true
@@ -31,8 +30,7 @@
     <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
-    <link rel="prev" title="Toolbox for controlling Lego Mindstorms EV3 with MATLAB" href="index.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
 <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
@@ -52,7 +50,7 @@
         </button>
         <a class="navbar-brand" href="index.html">
           Mindstorms EV3 Toolbox</a>
-        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
       </div>
 
         <div class="collapse navbar-collapse nav-collapse">
@@ -67,10 +65,15 @@
      href="index.html">Site <b class="caret"></b></a>
   <ul class="dropdown-menu globaltoc"
       role="menu"
-      aria-labelledby="dLabelGlobalToc"><ul class="current">
-<li class="toctree-l1 current"><a class="current reference internal" href="#">EV3</a></li>
-<li class="toctree-l1"><a class="reference internal" href="#motor">Motor</a></li>
-<li class="toctree-l1"><a class="reference internal" href="#sensor">Sensor</a></li>
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -85,8 +88,6 @@
       role="menu"
       aria-labelledby="dLabelLocalToc"><ul>
 <li><a class="reference internal" href="#">EV3</a></li>
-<li><a class="reference internal" href="#motor">Motor</a></li>
-<li><a class="reference internal" href="#sensor">Sensor</a></li>
 </ul>
 </ul>
 </li>
@@ -95,10 +96,6 @@
             
               
                 
-  <li>
-    <a href="index.html" title="Previous Chapter: Toolbox for controlling Lego Mindstorms EV3 with MATLAB"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Toolbox for c...</span>
-    </a>
-  </li>
               
             
             
@@ -135,7 +132,21 @@
 <dl class="class">
 <dt id="source.EV3">
 <em class="property">class </em><code class="descclassname">source.</code><code class="descname">EV3</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with physical bricks.</p>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.EV3.connect" title="source.EV3.connect"><code class="xref mat mat-meth docutils literal"><span class="pre">connect()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.disconnect" title="source.EV3.disconnect"><code class="xref mat mat-meth docutils literal"><span class="pre">disconnect()</span></code></a></li>
+<li><code class="xref mat mat-meth docutils literal"><span class="pre">stopAllMotors()</span></code></li>
+<li><a class="reference internal" href="#source.EV3.beep" title="source.EV3.beep"><code class="xref mat mat-meth docutils literal"><span class="pre">beep()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.playTone" title="source.EV3.playTone"><code class="xref mat mat-meth docutils literal"><span class="pre">playTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.stopTone" title="source.EV3.stopTone"><code class="xref mat mat-meth docutils literal"><span class="pre">stopTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.tonePlayed" title="source.EV3.tonePlayed"><code class="xref mat mat-meth docutils literal"><span class="pre">tonePlayed()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.setProperties" title="source.EV3.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with physical bricks.</p>
 <p>This is the &#8216;central&#8217; class (from user&#8217;s view) when working with this toolbox. It
 delivers a convenient interface for creating a connection to the brick and sending
 commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for each port.</p>
@@ -143,53 +154,57 @@ commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for eac
 <ul class="simple">
 <li>Creating multiple EV3 objects and connecting them to different physical bricks has not
 been thoroughly tested yet, but seems to work on a first glance.</li>
+<li>When an input argument of a method is marked as optional, the argument needs to be
+&#8216;announced&#8217; by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: <em>brickObject.motorA.setProperties(&#8216;power&#8217;, 50);</em></li>
 </ul>
 <dl class="attribute">
 <dt id="source.EV3.motorA">
 <code class="descname">motorA</code><a class="headerlink" href="#source.EV3.motorA" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Motor</em> &#8211; Motor-object interfacing port A</p>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port A. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.motorB">
 <code class="descname">motorB</code><a class="headerlink" href="#source.EV3.motorB" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Motor</em> &#8211; Motor-object interfacing port B</p>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port B. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.motorC">
 <code class="descname">motorC</code><a class="headerlink" href="#source.EV3.motorC" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Motor</em> &#8211; Motor-object interfacing port C</p>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port C. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.motorD">
 <code class="descname">motorD</code><a class="headerlink" href="#source.EV3.motorD" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Motor</em> &#8211; Motor-object interfacing port D</p>
+<dd><p><em>Motor</em> &#8211; Motor-object interfacing port D. See also <a class="reference internal" href="Motor.html#source.Motor" title="source.Motor"><code class="xref mat mat-class docutils literal"><span class="pre">Motor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.sensor1">
 <code class="descname">sensor1</code><a class="headerlink" href="#source.EV3.sensor1" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 1</p>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 1. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.sensor2">
 <code class="descname">sensor2</code><a class="headerlink" href="#source.EV3.sensor2" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 2</p>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 2. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.sensor3">
 <code class="descname">sensor3</code><a class="headerlink" href="#source.EV3.sensor3" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 3</p>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 3. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.sensor4">
 <code class="descname">sensor4</code><a class="headerlink" href="#source.EV3.sensor4" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 4</p>
+<dd><p><em>Sensor</em> &#8211; Motor-object interfacing port 4. See also <a class="reference internal" href="Sensor.html#source.Sensor" title="source.Sensor"><code class="xref mat mat-class docutils literal"><span class="pre">Sensor</span></code></a>.</p>
 </dd></dl>
 
 <dl class="attribute">
@@ -206,15 +221,13 @@ been thoroughly tested yet, but seems to work on a first glance.</li>
 <dl class="attribute">
 <dt id="source.EV3.batteryMode">
 <code class="descname">batteryMode</code><a class="headerlink" href="#source.EV3.batteryMode" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>string in {&#8216;Percentage&#8217;, &#8216;Voltage&#8217;}</em> &#8211; Mode for reading battery charge.
-<em>[WRITABLE]</em></p>
+<dd><p><em>string in {&#8216;Percentage&#8217;, &#8216;Voltage&#8217;}</em> &#8211; Mode for reading battery charge. See also <a class="reference internal" href="#source.EV3.batteryValue" title="source.EV3.batteryValue"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryValue</span></code></a>. <em>[WRITABLE]</em></p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.batteryValue">
 <code class="descname">batteryValue</code><a class="headerlink" href="#source.EV3.batteryValue" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric</em> &#8211; Current battery charge. Depending on batteryMode, the reading
-is either in percentage or voltage. <em>[READ-ONLY]</em></p>
+<dd><p><em>numeric</em> &#8211; Current battery charge. Depending on batteryMode, the reading is either in percentage or voltage. See also <a class="reference internal" href="#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a>. <em>[READ-ONLY]</em></p>
 </dd></dl>
 
 <dl class="attribute">
@@ -223,29 +236,30 @@ is either in percentage or voltage. <em>[READ-ONLY]</em></p>
 <dd><p><em>bool</em> &#8211; True if virtual brick-object is connected to physical one. <em>[READ-ONLY]</em></p>
 </dd></dl>
 
-<p class="rubric">Examples</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;usb&#8217;); <br />
-ma = b.motorA; <br />
-ma.setProperties(&#8216;power&#8217;, 50, &#8216;limitValue&#8217;, 720); <br />
-ma.start(); <br />
+<p class="rubric">Example</p>
+<p>% This example expects a motor at port A and a (random) sensor at port 1 <br />
+b = EV3(); % <br />
+b.connect(&#8216;usb&#8217;); % <br />
+ma = b.motorA; % <br />
+ma.setProperties(&#8216;power&#8217;, 50, &#8216;limitValue&#8217;, 720); % <br />
+ma.start(); % <br />
 % fun <br />
-b.sensor1.value <br />
-b.waitFor(); <br />
-b.beep(); <br />
-delete b; <br /></p>
+ma.waitFor(); % <br />
+disp(b.sensor1.value); % <br />
+b.beep(); % <br />
+delete b; % <br /></p>
 <dl class="method">
 <dt id="source.EV3.beep">
 <code class="descname">beep</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.beep" title="Permalink to this definition">¶</a></dt>
 <dd><p>Plays a &#8216;beep&#8217;-tone on brick.</p>
 <p class="rubric">Notes</p>
 <ul class="simple">
-<li>This equals playTone(10, 1000, 100) (Wraps the same opCode in comm-layer)</li>
+<li>This equals playTone(10, 1000, 100).</li>
 </ul>
 <p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
-b.beep(); <br /></p>
+<p>b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
+b.beep(); % <br /></p>
 </dd></dl>
 
 <dl class="method">
@@ -259,21 +273,21 @@ b.beep(); <br /></p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>connectionType</strong> (<em>string in {'bt', 'usb'}</em>) &#8211; Connection type</li>
 <li><strong>serPort</strong> (<em>string in {'/dev/rfcomm1', '/dev/rfcomm2', ...}</em>) &#8211; Path to serial port
-(if &#8216;bt&#8217;)</li>
-<li><strong>beep</strong> (<em>bool</em>) &#8211; If true, EV3 beeps if connection has been established</li>
+(necessary if connectionType is &#8216;bt&#8217;). <em>[OPTIONAL]</em></li>
+<li><strong>beep</strong> (<em>bool</em>) &#8211; If true, EV3 beeps if connection has been established. <em>[OPTIONAL]</em></li>
 </ul>
 </td>
 </tr>
 </tbody>
 </table>
-<p class="rubric">Examples</p>
+<p class="rubric">Example</p>
 <p>% Setup bluetooth connection via com-port 0 <br />
-b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
+b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
 % Setup usb connection, beep when connection has been established
-b = EV3(); <br />
-b.connect(&#8216;usb&#8217;, &#8216;beep&#8217;, &#8216;on&#8217;, ); <br /></p>
-<p>Check connection</p>
+b = EV3(); % <br />
+b.connect(&#8216;usb&#8217;, &#8216;beep&#8217;, &#8216;on&#8217;, ); % <br /></p>
+<p>See also ISCONNECTED / <a class="reference internal" href="#source.EV3.isConnected" title="source.EV3.isConnected"><code class="xref mat mat-attr docutils literal"><span class="pre">isConnected</span></code></a></p>
 </dd></dl>
 
 <dl class="method">
@@ -285,11 +299,14 @@ b.connect(&#8216;usb&#8217;, &#8216;beep&#8217;, &#8216;on&#8217;, ); <br /></p>
 <li>Gets called automatically when EV3-object is destroyed.</li>
 </ul>
 <p class="rubric">Example</p>
-<p>b = EV3();
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;);
-% do stuff
-b.disconnect();</p>
-<p>Reset motors and sensors before disconnecting</p>
+<p>b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
+% do stuff <br />
+b.disconnect(); % <br /></p>
+<p>Resetting needs a working connection in order to send reset-commands
+to the Brick. If the connection has been aborted (e.g. by pulling the
+USB-cord), the reset-methods would fail -&gt; catch this error and for
+now do nothing.</p>
 </dd></dl>
 
 <dl class="method">
@@ -303,15 +320,15 @@ b.disconnect();</p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>volume</strong> (<em>numeric in [0, 100]</em>) &#8211; in percent</li>
 <li><strong>frequency</strong> (<em>numeric in [250, 10000]</em>) &#8211; in Hertz</li>
-<li><strong>duration</strong> (<em>numeric &gt;0</em>) &#8211; in milliseconds</li>
+<li><strong>duration</strong> (<em>numeric &gt; 0</em>) &#8211; in milliseconds</li>
 </ul>
 </td>
 </tr>
 </tbody>
 </table>
 <p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
+<p>b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
 b.playTone(40, 5000, 1000);  % Plays tone with 40% volume and 5000Hz for 1
 second. <br /></p>
 </dd></dl>
@@ -333,26 +350,20 @@ second. <br /></p>
 </tbody>
 </table>
 <p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
-b.setProperties(&#8216;debug&#8217;, &#8216;on&#8217;, &#8216;batteryMode&#8217;, &#8216;Voltage&#8217;); <br />
-% Instead of: b.debug = &#8216;on&#8217;; b.batteryMode = &#8216;Voltage&#8217;; <br /></p>
-<p>See also EV3.DEBUG, EV3.BATTERYMODE</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.EV3.stopAllMotors">
-<code class="descname">stopAllMotors</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.stopAllMotors" title="Permalink to this definition">¶</a></dt>
-<dd><p>Sends a stop-command to all motor-ports</p>
+<p>b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
+b.setProperties(&#8216;debug&#8217;, &#8216;on&#8217;, &#8216;batteryMode&#8217;, &#8216;Voltage&#8217;); % <br />
+% Instead of: b.debug = &#8216;on&#8217;; b.batteryMode = &#8216;Voltage&#8217;; % <br /></p>
+<p>See also EV3.DEBUG, EV3.BATTERYMODE / <a class="reference internal" href="#source.EV3.debug" title="source.EV3.debug"><code class="xref mat mat-attr docutils literal"><span class="pre">debug</span></code></a>, <a class="reference internal" href="#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a></p>
 </dd></dl>
 
 <dl class="method">
 <dt id="source.EV3.stopTone">
 <code class="descname">stopTone</code><span class="sig-paren">(</span><em>ev3</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3.stopTone" title="Permalink to this definition">¶</a></dt>
-<dd><p>Stops tone currently played</p>
+<dd><p>Stops tone currently played.</p>
 <p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
+<p>b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
 b.playTone(10,100,100000000);  % Accidentally given wrong tone duration :) <br />
 b.stopTone();  % Stops tone immediately. <br /></p>
 </dd></dl>
@@ -373,558 +384,16 @@ b.stopTone();  % Stops tone immediately. <br /></p>
 </table>
 <dl class="docutils">
 <dt>Example</dt>
-<dd>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
-b.playTone(10, 100, 1000); <br />
-pause(0.5); <br />
-b.tonePlayed() -&gt; Outputs 1 to console. <br /></dd>
+<dd>b = EV3(); % <br />
+b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); % <br />
+b.playTone(10, 100, 1000); % <br />
+pause(0.5); % Small pause is necessary as tone does not start instantaneously <br />
+b.tonePlayed(); % -&gt; Outputs 1 to console.  <br /></dd>
 </dl>
 </dd></dl>
 
 </dd></dl>
 
-</div>
-<div class="section" id="motor">
-<h1>Motor<a class="headerlink" href="#motor" title="Permalink to this headline">¶</a></h1>
-<dl class="class">
-<dt id="source.Motor">
-<em class="property">class </em><code class="descclassname">source.</code><code class="descname">Motor</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with motors.</p>
-<p>This class is supposed to ease the use of the brick&#8217;s motors. It is possible to set all
-kinds of parameters, request the current status of the motor ports and of course send
-commands to the brick to be executed on the respective port.</p>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>You don&#8217;t need to create instances of this class. The EV3-class automatically creates
-instances for each motor port, and you can work with them via the EV3-object.</li>
-<li>The Motor-class represents motor ports, not individual motors!</li>
-<li>If you start a motor with power=0, the internal state will still be set to
-&#8216;isRunning&#8217;</li>
-</ul>
-<dl class="attribute">
-<dt id="source.Motor.power">
-<code class="descname">power</code><a class="headerlink" href="#source.Motor.power" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric in [-100, 100]</em> &#8211; Power level of motor in percent. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.speedRegulation">
-<code class="descname">speedRegulation</code><a class="headerlink" href="#source.Motor.speedRegulation" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>bool</em> &#8211; Speed regulation turned on or off. When turned on, motor will
-try to &#8216;hold&#8217; its speed at given power level, whatever the load. In this mode, the
-highest possible speed depends on the load and mostly goes up to around 70-80 (at
-this point, the Brick internally input 100% power). When turned off, motor will
-constantly input the same power into the motor. The resulting speed will be
-somewhat lower, depending on the load. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.smoothStart">
-<code class="descname">smoothStart</code><a class="headerlink" href="#source.Motor.smoothStart" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric s. t. smoothStart+smoothStop &lt; limitValue</em> &#8211; Degrees/Time
-indicating how far/long the motor should smoothly start. Depending on limitMode,
-the input is interpreted either in degrees or milliseconds. The first
-{smoothStart}-milliseconds/degrees of limitValue the motor will slowly accelerate
-until reaching its defined speed. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.smoothStop">
-<code class="descname">smoothStop</code><a class="headerlink" href="#source.Motor.smoothStop" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric s. t. smoothStart+smoothStop &lt; limitValue</em> &#8211; Degrees/Time
-indicating how far/long the motor should smoothly stop. Depending on limitMode, the
-input is interpreted either in degrees or milliseconds. The last
-[smoothStop]-milliseconds/degrees of limitValue the motor will slowly slow down
-until it has stopped. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.limitValue">
-<code class="descname">limitValue</code><a class="headerlink" href="#source.Motor.limitValue" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric&gt;=0</em> &#8211; Degrees/Time indicating how far/long the motor should run.
-Depending on limitMode, the input is interpreted either in degrees or
-milliseconds. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.limitMode">
-<code class="descname">limitMode</code><a class="headerlink" href="#source.Motor.limitMode" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>&#8216;Tacho&#8217;|&#8217;Time&#8217;</em> &#8211; Mode for motor limit. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.brakeMode">
-<code class="descname">brakeMode</code><a class="headerlink" href="#source.Motor.brakeMode" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>&#8216;Brake&#8217;|&#8217;Coast&#8217;</em> &#8211; Action done when stopping. If &#8216;Coast&#8217;, the motor will (at
-tacholimit, if ~=0) coast to a stop. If &#8216;Brake&#8217;, the motor will stop immediately
-(at tacholimit, if ~=0) and hold the brake. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.debug">
-<code class="descname">debug</code><a class="headerlink" href="#source.Motor.debug" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>bool</em> &#8211; Debug turned on or off. In debug mode, everytime a command is passed to
-the sublayer (&#8216;communication layer&#8217;), there is feedback in the console about what
-command has been called. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.isRunning">
-<code class="descname">isRunning</code><a class="headerlink" href="#source.Motor.isRunning" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>bool</em> &#8211; True if motor is running. <em>[READ-ONLY]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.tachoCount">
-<code class="descname">tachoCount</code><a class="headerlink" href="#source.Motor.tachoCount" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric</em> &#8211; Current tacho count. <em>[READ-ONLY]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.currentSpeed">
-<code class="descname">currentSpeed</code><a class="headerlink" href="#source.Motor.currentSpeed" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric</em> &#8211; Current speed of motor. If speedRegulation=on this should equal power,
-otherwise it will probably be lower than that. <em>[READ-ONLY]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Motor.type">
-<code class="descname">type</code><a class="headerlink" href="#source.Motor.type" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>DeviceType</em> &#8211; Type of connected device if any. <em>[READ-ONLY]</em></p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.internalReset">
-<code class="descname">internalReset</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.internalReset" title="Permalink to this definition">¶</a></dt>
-<dd><p>Resets internal tacho count. Use this if motor behaves weird (i.e. not starting at all, or not correctly
-running to limitValue)</p>
-<p>The internal tacho count is used for positioning the motor. When the
-motor is running with a tacho limit, internally it uses another counter than the
-one read by tachoCount. This internal tacho count needs to be reset if you
-physically change the motor&#8217;s position or it coasted into a stop. If the motor&#8217;s
-brakemode is &#8216;Coast&#8217;, this function is called automatically.</p>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>A better name would probably be resetPosition...</li>
-<li>Gets called automatically when starting the motor and the internal tacho</li>
-</ul>
-<p>count is &gt; 0</p>
-<p>See also MOTOR.RESETTACHOCOUNT</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.resetTachoCount">
-<code class="descname">resetTachoCount</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.resetTachoCount" title="Permalink to this definition">¶</a></dt>
-<dd><p>Resets tachocount</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.setBrake">
-<code class="descname">setBrake</code><span class="sig-paren">(</span><em>motor</em>, <em>brake</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.setBrake" title="Permalink to this definition">¶</a></dt>
-<dd><p>Apply or release brake of motor</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>brake</strong> (<em>bool</em>) &#8211; If true, brake will be pulled</td>
-</tr>
-</tbody>
-</table>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.setProperties">
-<code class="descname">setProperties</code><span class="sig-paren">(</span><em>motor</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.setProperties" title="Permalink to this definition">¶</a></dt>
-<dd><p>Sets multiple Motor properties at once using MATLAB&#8217;s inputParser.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>debug</strong> (<em>bool</em>) &#8211; </li>
-<li><strong>smoothStart</strong> (<em>numeric in [0, limitValue]</em>) &#8211; </li>
-<li><strong>smoothStop</strong> (<em>numeric in [0, limitValue]</em>) &#8211; </li>
-<li><strong>speedRegulation</strong> (<em>bool</em>) &#8211; </li>
-<li><strong>brakeMode</strong> (<em>'Coast'|'Brake'</em>) &#8211; </li>
-<li><strong>limitMode</strong> (<em>'Time'|'Tacho'</em>) &#8211; </li>
-<li><strong>limitValue</strong> (<em>numeric &gt; 0</em>) &#8211; </li>
-<li><strong>power</strong> (<em>numeric in [-100,100]</em>) &#8211; </li>
-<li><strong>batteryMode</strong> (<em>'Voltage'|'Percentage'</em>) &#8211; </li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
-b.motorA.setProperties(&#8216;debug&#8217;, &#8216;on&#8217;, &#8216;power&#8217;, 50, &#8216;limitValue&#8217;, 720, &#8216;speedRegulation&#8217;, &#8216;on&#8217;); <br />
-% Instead of: b.motorA.debug = &#8216;on&#8217;; <br />
-%             b.motorA.power = 50; <br />
-%             b.motorA.limitValue = 720; <br />
-%             b.motorA.speedRegulation = &#8216;on&#8217;; <br /></p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.start">
-<code class="descname">start</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.start" title="Permalink to this definition">¶</a></dt>
-<dd><p>Starts the motor</p>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>Right now, alternatingly calling this function with and without tacho limit
-may lead to unexpected behaviour. For example, if you run the motor without
-a tacholimit for some time using Coast, then stop using Coast, and then try
-to run the with a tacholimit, it will stop sooner or later than expected,
-or may not even start at all.</li>
-<li>(OLD)After calling one of the functions to control the motor with some kind of
-limit (which is done if limit~=0), the physical brick&#8217;s power/speed value for
-starting without a limit (i.e. if limit==0) is reset to zero. So if you want
-to control the motor without a limit after doing so with a limit, you would
-have to set the power manually to the desired value again. (I don&#8217;t really
-know if this is deliberate or a bug, and at this point, I&#8217;m too afraid to ask.)
-To avoid confusion, this is done automatically in this special case.
-However, this does not even work all the time. If motor does not
-start, call stop() and setPower() manually. :/</li>
-</ul>
-<p>Check connection and if motor is already running</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.stop">
-<code class="descname">stop</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.stop" title="Permalink to this definition">¶</a></dt>
-<dd><p>Stops the motor</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.syncedStart">
-<code class="descname">syncedStart</code><span class="sig-paren">(</span><em>motor</em>, <em>syncMotor</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.syncedStart" title="Permalink to this definition">¶</a></dt>
-<dd><p>Starts this motor synchronized with another</p>
-<p>This motor acts as a &#8216;master&#8217;, meaning that the synchronized control is done via
-this one. When syncedStart is called, the master sets some of the slave&#8217;s
-(syncMotor) properties to keep it consistent with the physical brick. So, for
-example, changing the power on the master motor will take effect
-on the slave as soon as this method is called.
-The following parameters will be affected on the slave: power, brakeMode,
-limitValue, speedRegulation</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>syncMotor</strong> (<em>Motor</em>) &#8211; the motor-object to sync with</li>
-<li><strong>turnRatio</strong> (<em>numeric in [-200,200]</em>) &#8211; <p><em>[OPTIONAL]</em> <br /> (Excerpt of Firmware-comments, in c_output.c):
-&#8220;Turn ratio is how tight you turn and to what direction you turn.</p>
-<blockquote>
-<div><ul>
-<li>0 value is moving straight forward</li>
-<li>Negative values turn to the left</li>
-<li>Positive values turn to the right</li>
-<li>Value -100 stops the left motor</li>
-<li>Value +100 stops the right motor</li>
-<li>Values less than -100 makes the left motor run the opposite direction of the right motor (Spin)</li>
-<li>Values greater than +100 makes the right motor run the opposite direction of the left motor (Spin)&#8221;</li>
-</ul>
-</div></blockquote>
-</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>This is right now a pretty &#8216;heavy&#8217; function, as it tests if both motors are
-connected AND aren&#8217;t running, wasting four packets, keep that in mind</li>
-<li>It is necessary to call syncedStop() and not stop() for stopping the motors
-(otherwise the sync-state cannot be exited correctly)</li>
-</ul>
-<p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;usb&#8217;); <br />
-m = b.motorA; <br />
-slave = b.motorB; <br />
-m.power = 50; <br />
-m.syncedStart(slave); <br />
-% Do stuff
-m.syncedStop(); <br /></p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.syncedStop">
-<code class="descname">syncedStop</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.syncedStop" title="Permalink to this definition">¶</a></dt>
-<dd><p>Stops both motors previously started with syncedStart.</p>
-<p>See also MOTOR.SYNCEDSTART</p>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Motor.waitFor">
-<code class="descname">waitFor</code><span class="sig-paren">(</span><em>motor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor.waitFor" title="Permalink to this definition">¶</a></dt>
-<dd><p>Stops execution of program as long as motor is running</p>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>(OLD)This one&#8217;s a bit tricky. The opCode OutputReady makes the brick stop sending
-responses until the motor has stopped. For security reasons, in this toolbox
-there is an internal timeout for receiving messages from the brick. It raises
-an error if a reply takes too long, which would happen in this case. As a
-workaround, there is an infinite loop that catches errors from outputReady and
-continues then, until outputReady will actually finish without an error.</li>
-<li>(OLD)OutputReady (like OutputTest in isRunning) sometimes doesn&#8217;t work. If
-outputReady returns in less than a second, another while-loop iterates until
-the motor has stopped, this time using motor.isRunning() (this only works as
-long as not both OutputTest and OutputReady are buggy).</li>
-<li>(OLD)Workaround: Poll isRunning (which itself return (speed&gt;0)) until it
-is false (No need to check if motor is connected as speed correctly
-returns 0 if it&#8217;s not)</li>
-</ul>
-</dd></dl>
-
-</dd></dl>
-
-</div>
-<div class="section" id="sensor">
-<h1>Sensor<a class="headerlink" href="#sensor" title="Permalink to this headline">¶</a></h1>
-<dl class="class">
-<dt id="source.Sensor">
-<em class="property">class </em><code class="descclassname">source.</code><code class="descname">Sensor</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with sensors.</p>
-<p>The Sensor-class facilitates the communication with sensors. This mainly consists of
-reading the sensor&#8217;s type and current value in a specified mode.</p>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>You don&#8217;t need to create instances of this class. The EV3-class automatically creates
-instances for each sensor port, and you can work with them via the EV3-object.</li>
-<li>The Sensor-class represents sensor ports, not individual sensors!</li>
-</ul>
-<dl class="attribute">
-<dt id="source.Sensor.mode">
-<code class="descname">mode</code><a class="headerlink" href="#source.Sensor.mode" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>DeviceMode.{Type}</em> &#8211; Sensor mode in which the value will be read. By default,
-mode is set to DeviceMode.Default.Undefined. Once a physical sensor is connected
-to the port <em>and</em> the physical Brick is connected to the EV3-object, the allowed
-mode and the default mode for a Sensor-object are the following (depending on the
-sensor type): <em>[WRITABLE]</em></p>
-<blockquote>
-<div><ul>
-<li><dl class="first docutils">
-<dt>Touch-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.Touch.Pushed <em>[Default]</em></li>
-<li>DeviceMode.Touch.Bumps</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>Ultrasonic-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.UltraSonic.DistCM <em>[Default]</em></li>
-<li>DeviceMode.UltraSonic.DistIn</li>
-<li>DeviceMode.UltraSonic.Listen</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>Color-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.Color.Reflect <em>[Default]</em></li>
-<li>DeviceMode.Color.Ambient</li>
-<li>DeviceMode.Color.Col</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>Gyro-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.Gyro.Angular <em>[Default]</em></li>
-<li>DeviceMode.Gyro.Rate</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>Infrared-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.InfraRed.Prox <em>[Default]</em></li>
-<li>DeviceMode.InfraRed.Seek</li>
-<li>DeviceMode.InfraRed.Remote</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>NXTColor-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.NXTColor.Reflect <em>[Default]</em></li>
-<li>DeviceMode.NXTColor.Ambient</li>
-<li>DeviceMode.NXTColor.Color</li>
-<li>DeviceMode.NXTColor.Green</li>
-<li>DeviceMode.NXTColor.Blue</li>
-<li>DeviceMode.NXTColor.Raw</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>NXTLight-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.NXTLight.Reflect <em>[Default]</em></li>
-<li>DeviceMode.NXTLight.Ambient</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>NXTSound-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.NXTSound.DB <em>[Default]</em></li>
-<li>DeviceMode.NXTSound.DBA</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>NXTTemperature-Sensor</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.NXTTemperature.C <em>[Default]</em></li>
-<li>DeviceMode.NXTTemperature.F</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>NXTTouch-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.NXTTouch.Pushed <em>[Default]</em></li>
-<li>DeviceMode.NXTTouch.Bumps</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>NXTUltraSonic-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.NXTUltraSonic.CM <em>[Default]</em></li>
-<li>DeviceMode.NXTUltraSonic.IN</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>HTAccelerometer-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.HTAccelerometer.Acceleration <em>[Default]</em></li>
-<li>DeviceMode.HTAccelerometer.AccelerationAllAxes</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>HTCompass-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.HTCompass.Degrees <em>[Default]</em></li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><dl class="first docutils">
-<dt>HTColor-Sensor:</dt>
-<dd><ul class="first last simple">
-<li>DeviceMode.HTColor.Col <em>[Default]</em></li>
-<li>DeviceMode.HTColor.Red</li>
-<li>DeviceMode.HTColor.Green</li>
-<li>DeviceMode.HTColor.Blue</li>
-<li>DeviceMode.HTColor.White</li>
-<li>DeviceMode.HTColor.Raw</li>
-<li>DeviceMode.HTColor.Nr,</li>
-<li>DeviceMode.HTColor.All</li>
-</ul>
-</dd>
-</dl>
-</li>
-</ul>
-</div></blockquote>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Sensor.debug">
-<code class="descname">debug</code><a class="headerlink" href="#source.Sensor.debug" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>bool</em> &#8211; Debug turned on or off. In debug mode, everytime a command is passed to
-the sublayer (&#8216;communication layer&#8217;), there is feedback in the console about what
-command has been called. <em>[WRITABLE]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Sensor.value">
-<code class="descname">value</code><a class="headerlink" href="#source.Sensor.value" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric</em> &#8211; Value read from hysical sensor. What the value represents depends on
-sensor.mode. <em>[READ-ONLY]</em></p>
-</dd></dl>
-
-<dl class="attribute">
-<dt id="source.Sensor.type">
-<code class="descname">type</code><a class="headerlink" href="#source.Sensor.type" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>DeviceType</em> &#8211; Type of physical sensor connected to the port. Possible types are: [READ-ONLY]</p>
-<ul class="simple">
-<li>DeviceType.NXTTouch</li>
-<li>DeviceType.NXTLight</li>
-<li>DeviceType.NXTSound</li>
-<li>DeviceType.NXTColor</li>
-<li>DeviceType.NXTUltraSonic</li>
-<li>DeviceType.NXTTemperature</li>
-<li>DeviceType.LargeMotor</li>
-<li>DeviceType.MediumMotor</li>
-<li>DeviceType.Touch</li>
-<li>DeviceType.Color</li>
-<li>DeviceType.UltraSonic</li>
-<li>DeviceType.Gyro</li>
-<li>DeviceType.InfraRed</li>
-<li>DeviceType.HTColor</li>
-<li>DeviceType.HTCompass</li>
-<li>DeviceType.HTAccelerometer</li>
-<li>DeviceType.Unknown</li>
-<li>DeviceType.None</li>
-<li>DeviceType.Error</li>
-</ul>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Sensor.reset">
-<code class="descname">reset</code><span class="sig-paren">(</span><em>sensor</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor.reset" title="Permalink to this definition">¶</a></dt>
-<dd><p>Resets value on sensor</p>
-<p class="rubric">Notes</p>
-<ul class="simple">
-<li>This clears ALL the sensors right now, no other Op-Code available... :(</li>
-</ul>
-</dd></dl>
-
-<dl class="method">
-<dt id="source.Sensor.setProperties">
-<code class="descname">setProperties</code><span class="sig-paren">(</span><em>sensor</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor.setProperties" title="Permalink to this definition">¶</a></dt>
-<dd><p>Sets multiple Sensor properties at once using MATLAB&#8217;s inputParser.</p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
-<li><strong>debug</strong> (<em>bool</em>) &#8211; </li>
-<li><strong>mode</strong> (<em>DeviceMode.{Type}</em>) &#8211; </li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<p class="rubric">Example</p>
-<p>b = EV3(); <br />
-b.connect(&#8216;bt&#8217;, &#8216;serPort&#8217;, &#8216;/dev/rfcomm0&#8217;); <br />
-b.sensor1.setProperties(&#8216;debug&#8217;, &#8216;on&#8217;, &#8216;mode&#8217;, DeviceMode.Color.Ambient); <br />
-% Instead of: b.sensor1.debug = &#8216;on&#8217;; <br />
-%             b.sensor1.mode = DeviceMode.Color.Ambient; <br /></p>
-</dd></dl>
-
-</dd></dl>
-
 </div>
 
 
@@ -939,7 +408,7 @@ b.sensor1.setProperties(&#8216;debug&#8217;, &#8216;on&#8217;, &#8216;mode&#8217
       
     </p>
     <p>
-        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
     </p>
   </div>
diff --git a/docs/_build/html/test.html b/docs/_build/html/test.html
new file mode 100644
index 0000000000000000000000000000000000000000..50e55fbfa85e2276a11515d77c10c6e88f409b75
--- /dev/null
+++ b/docs/_build/html/test.html
@@ -0,0 +1,445 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>hidapi &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="next" title="usbBrickIO" href="usbBrickIO.html" />
+    <link rel="prev" title="Sensor" href="Sensor.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">hidapi</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="Sensor.html" title="Previous Chapter: Sensor"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Sensor</span>
+    </a>
+  </li>
+  <li>
+    <a href="usbBrickIO.html" title="Next Chapter: usbBrickIO"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">usbBrickIO &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/test.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="hidapi">
+<h1>hidapi<a class="headerlink" href="#hidapi" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.hidapi">
+<em class="property">class </em><code class="descclassname">source.</code><code class="descname">hidapi</code><span class="sig-paren">(</span><em>vendorID</em>, <em>productID</em>, <em>nReadBuffer</em>, <em>nWriteBuffer</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi" title="Permalink to this definition">¶</a></dt>
+<dd><p>Interface to the hidapi library</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Developed from the hidapi available at <a class="reference external" href="http://www.signal11.us/oss/hidapi/">http://www.signal11.us/oss/hidapi/</a>.</li>
+<li>Windows: hidapi.dll needed.</li>
+<li>Mac: hidapi.dylib needed. In addition, Xcode has to be installed.</li>
+<li>Linux: hidapi has to be compiled on host-system.</li>
+</ul>
+<dl class="attribute">
+<dt id="source.hidapi.handle">
+<code class="descname">handle</code><a class="headerlink" href="#source.hidapi.handle" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.vendorID">
+<code class="descname">vendorID</code><a class="headerlink" href="#source.hidapi.vendorID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Vendor-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.productID">
+<code class="descname">productID</code><a class="headerlink" href="#source.hidapi.productID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Product-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nReadBuffer">
+<code class="descname">nReadBuffer</code><a class="headerlink" href="#source.hidapi.nReadBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Read-buffer size in bytes.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nWriteBuffer">
+<code class="descname">nWriteBuffer</code><a class="headerlink" href="#source.hidapi.nWriteBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.slib">
+<code class="descname">slib</code><a class="headerlink" href="#source.hidapi.slib" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library file (without file extension). Defaults to
+&#8216;hidapi&#8217;.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.sheader">
+<code class="descname">sheader</code><a class="headerlink" href="#source.hidapi.sheader" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library header. Defaults to &#8216;hidapi.h&#8217;.</p>
+</dd></dl>
+
+<p class="rubric">Example</p>
+<p>hidHandle = hidapi(1684,0005,1024,1025); %|br|</p>
+<dl class="method">
+<dt id="source.hidapi.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Close the connection to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when deleting the hidapi instance.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.enumerate">
+<code class="descname">enumerate</code><span class="sig-paren">(</span><em>hid</em>, <em>vendorID</em>, <em>productID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.enumerate" title="Permalink to this definition">¶</a></dt>
+<dd><p>Enumerates the info about the hid device with the given vendorID and productID
+and returns a string with the returned hid information.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>vendorID</strong> (<em>numeric</em>) &#8211; Vendor-ID of the USB device in decimal.</li>
+<li><strong>productID</strong> (<em>numeric</em>) &#8211; Product-ID of the USB device in decimal.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Using a vendorID and productID of (0,0) will enumerate all connected hid
+devices.</li>
+<li>MATLAB does not have the hid_device_infoPtr struct so some of the returned
+information will need to be resized and cast into uint8 or chars.</li>
+</ul>
+<p>Enumerate the hid devices</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.error">
+<code class="descname">error</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.error" title="Permalink to this definition">¶</a></dt>
+<dd><p>Return the hid device error string if a function produced an error.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This function must be called explicitly if you think an error was generated
+from the hid device.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.exit">
+<code class="descname">exit</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.exit" title="Permalink to this definition">¶</a></dt>
+<dd><p>hidapi.exit Exit hidapi</p>
+<p>hid.exit() exits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p>Notes::
+- You should not have to call this function directly.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getHIDInfoString">
+<code class="descname">getHIDInfoString</code><span class="sig-paren">(</span><em>hid</em>, <em>info</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getHIDInfoString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the corresponding hid info from the hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Info is the hid information string.</li>
+</ul>
+<p>See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+HIDAPI.GETSERIALNUMBERSTRING.</p>
+<p>Read buffer nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getManufacturersString">
+<code class="descname">getManufacturersString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getManufacturersString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get manufacturers string from hid object using getHIDInfoString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getProductString">
+<code class="descname">getProductString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getProductString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get product string from hid object using getProductString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getSerialNumberString">
+<code class="descname">getSerialNumberString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getSerialNumberString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get serial number from hid object using getSerialNumberString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.init">
+<code class="descname">init</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.init" title="Permalink to this definition">¶</a></dt>
+<dd><p>Inits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This is called automatically in the library itself with the open function. You
+should not have to call this function directly.</li>
+</ul>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Open a connection with a hid device</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when creating an hidapi-object.</li>
+<li>The pointer return value from this library call is always null so it is not
+possible to know if the open was successful.</li>
+<li>The final parameter to the open hidapi library call has different types
+depending on OS. On windows it is uint16, on linux/mac int32.</li>
+</ul>
+<p>Create a null pointer for the hid_open function (depends on OS)</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device and returns the read bytes.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if no data was read.</li>
+</ul>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read_timeout">
+<code class="descname">read_timeout</code><span class="sig-paren">(</span><em>hid</em>, <em>timeOut</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read_timeout" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device with a timeout and return the read bytes.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeOut</strong> (<em>numeric &gt;= 0</em>) &#8211; Milliseconds after which a timeout-error occurs if no
+packet could be read.</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.setNonBlocking">
+<code class="descname">setNonBlocking</code><span class="sig-paren">(</span><em>hid</em>, <em>nonblock</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.setNonBlocking" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set the non blocking flag on the hid device connection.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nonblock</strong> (<em>numeric in {0,1}</em>) &#8211; 0 disables nonblocking, 1 enables nonblocking</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>hid</em>, <em>wmsg</em>, <em>reportID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Write to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if there is a mismatch between the buffer size and the
+reported number of bytes written.</li>
+</ul>
+<p>Append a 0 at the front for HID report ID</p>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/usbBrickIO.html b/docs/_build/html/usbBrickIO.html
new file mode 100644
index 0000000000000000000000000000000000000000..159476a1b46c199b3e98763cdd96b50317ba5667
--- /dev/null
+++ b/docs/_build/html/usbBrickIO.html
@@ -0,0 +1,273 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>usbBrickIO &#8212; Mindstorms EV3 Toolbox v1.0 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v1.0 documentation" href="index.html" />
+    <link rel="next" title="btBrickIO" href="btBrickIO.html" />
+    <link rel="prev" title="hidapi" href="hid.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v1.0</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">usbBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="hid.html" title="Previous Chapter: hidapi"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; hidapi</span>
+    </a>
+  </li>
+  <li>
+    <a href="btBrickIO.html" title="Next Chapter: btBrickIO"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">btBrickIO &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/usbBrickIO.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="usbbrickio">
+<h1>usbBrickIO<a class="headerlink" href="#usbbrickio" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.usbBrickIO">
+<em class="property">class </em><code class="descname">usbBrickIO</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.usbBrickIO.open" title="source.usbBrickIO.open"><code class="xref mat mat-meth docutils literal"><span class="pre">open()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.close" title="source.usbBrickIO.close"><code class="xref mat mat-meth docutils literal"><span class="pre">close()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.read" title="source.usbBrickIO.read"><code class="xref mat mat-meth docutils literal"><span class="pre">read()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.write" title="source.usbBrickIO.write"><code class="xref mat mat-meth docutils literal"><span class="pre">write()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.setProperties" title="source.usbBrickIO.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>USB interface between MATLAB and the brick</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Uses the hid library implementation in hidapi.m</li>
+<li>The default parameters should always work when you try to connect to an EV3 brick,
+so in nearly all use-cases, the constructor does not need any parameters (besides
+'debug' eventually).</li>
+</ul>
+<dl class="attribute">
+<dt id="source.usbBrickIO.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.usbBrickIO.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; If true, each open/close/read/write-call will be noted in the console.
+Defaults to false.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.vendorID">
+<code class="descname">vendorID</code><a class="headerlink" href="#source.usbBrickIO.vendorID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.productID">
+<code class="descname">productID</code><a class="headerlink" href="#source.usbBrickIO.productID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.nReadBuffer">
+<code class="descname">nReadBuffer</code><a class="headerlink" href="#source.usbBrickIO.nReadBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Read-buffer size in bytes. Defaults to 1024.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.nWriteBuffer">
+<code class="descname">nWriteBuffer</code><a class="headerlink" href="#source.usbBrickIO.nWriteBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet. Defaults to 1025 (EV3 USB maximum packet size = 1024).</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.timeOut">
+<code class="descname">timeOut</code><a class="headerlink" href="#source.usbBrickIO.timeOut" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric &gt;= 0</em> &#8211; Milliseconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10000.</p>
+</dd></dl>
+
+<p class="rubric">Examples</p>
+<p>% Connecting via USB <br />
+commHandle = usbBrickIO(); % <br />
+% Connecting via USB with enabled debug output <br />
+commHandle = usbBrickIO('debug', true); % <br /></p>
+<dl class="method">
+<dt id="source.usbBrickIO.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Closes the usb connection the brick through the hidapi interface.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Opens the usb connection to the brick through the hidapi interface.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Reads data from the brick through usb using the hidapi interface and returns the data in uint8 format.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>brickIO</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sets multiple usbBrickIO properties at once using MATLAB's inputParser.</p>
+<p>The syntax is as follows: commHandle.setProperties('propertyName1',
+propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, vendorID, productID, nReadBuffer, nWriteBuffer, timeOut.</p>
+<p>See also USBBRICKIO.DEBUG, USBBRICKIO.VENDORID, USBBRICKIO.PRODUCTID,
+USBBRICKIO.NREADBUFFER, USBBRICKIO.NWRITEBUFFER, USBBRICKIO.TIMEOUT</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>brickIO</em>, <em>wmsg</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Writes data to the brick through usb using the hidapi interface.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>wmsg</strong> (<em>uint8 array</em>) &#8211; Data to be written to the brick via usb</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2017, RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.aux b/docs/_build/latex/MindstormsEV3Toolbox.aux
index 82c29bb5e89106079ad039fa64d17c39f2053bd3..a0c16aa6b05344ad100cde5917ecc535f9ab607b 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.aux
+++ b/docs/_build/latex/MindstormsEV3Toolbox.aux
@@ -21,98 +21,167 @@
 \@writefile{lof}{\select@language{english}}
 \@writefile{lot}{\select@language{english}}
 \newlabel{index::doc}{{}{1}{}{section*.2}{}}
-\newlabel{source:module-source}{{}{1}{}{section*.3}{}}
-\@writefile{toc}{\contentsline {chapter}{\numberline {1}EV3}{3}{chapter.1}}
+\@writefile{toc}{\contentsline {chapter}{\numberline {1}Contents}{3}{chapter.1}}
 \@writefile{lof}{\addvspace {10\p@ }}
 \@writefile{lot}{\addvspace {10\p@ }}
 \@writefile{loliteral-block}{\addvspace {10\p@ }}
-\newlabel{source:ev3}{{1}{3}{EV3}{chapter.1}{}}
-\newlabel{source::doc}{{1}{3}{EV3}{chapter.1}{}}
-\newlabel{source:toolbox-for-controlling-lego-mindstorms-ev3-with-matlab}{{1}{3}{EV3}{chapter.1}{}}
-\newlabel{source:source.EV3}{{1}{3}{EV3}{section*.4}{}}
+\newlabel{index:our-repository}{{1}{3}{Contents}{chapter.1}{}}
+\newlabel{index:contents}{{1}{3}{Contents}{chapter.1}{}}
+\newlabel{index:matlab-toolbox-for-controlling-lego-mindstorms-ev3}{{1}{3}{Contents}{chapter.1}{}}
+\newlabel{EV3:module-source}{{1}{3}{Contents}{section*.3}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.1}EV3}{3}{section.1.1}}
+\newlabel{EV3:ev3}{{1.1}{3}{EV3}{section.1.1}{}}
+\newlabel{EV3::doc}{{1.1}{3}{EV3}{section.1.1}{}}
+\newlabel{EV3:source.EV3}{{1.1}{3}{EV3}{section*.4}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{3}{paragraph*.5}}
-\newlabel{source:source.EV3.motorA}{{1}{3}{Notes}{section*.6}{}}
-\newlabel{source:source.EV3.motorB}{{1}{3}{Notes}{section*.7}{}}
-\newlabel{source:source.EV3.motorC}{{1}{3}{Notes}{section*.8}{}}
-\newlabel{source:source.EV3.motorD}{{1}{3}{Notes}{section*.9}{}}
-\newlabel{source:source.EV3.sensor1}{{1}{3}{Notes}{section*.10}{}}
-\newlabel{source:source.EV3.sensor2}{{1}{3}{Notes}{section*.11}{}}
-\newlabel{source:source.EV3.sensor3}{{1}{3}{Notes}{section*.12}{}}
-\newlabel{source:source.EV3.sensor4}{{1}{3}{Notes}{section*.13}{}}
-\newlabel{source:source.EV3.debug}{{1}{3}{Notes}{section*.14}{}}
-\newlabel{source:source.EV3.batteryMode}{{1}{3}{Notes}{section*.15}{}}
-\newlabel{source:source.EV3.batteryValue}{{1}{4}{Notes}{section*.16}{}}
-\newlabel{source:source.EV3.isConnected}{{1}{4}{Notes}{section*.17}{}}
-\@writefile{toc}{\contentsline {paragraph}{Examples}{4}{paragraph*.18}}
-\newlabel{source:source.EV3.beep}{{1}{4}{Examples}{section*.19}{}}
+\newlabel{EV3:source.EV3.motorA}{{1.1}{3}{Notes}{section*.6}{}}
+\newlabel{EV3:source.EV3.motorB}{{1.1}{3}{Notes}{section*.7}{}}
+\newlabel{EV3:source.EV3.motorC}{{1.1}{3}{Notes}{section*.8}{}}
+\newlabel{EV3:source.EV3.motorD}{{1.1}{4}{Notes}{section*.9}{}}
+\newlabel{EV3:source.EV3.sensor1}{{1.1}{4}{Notes}{section*.10}{}}
+\newlabel{EV3:source.EV3.sensor2}{{1.1}{4}{Notes}{section*.11}{}}
+\newlabel{EV3:source.EV3.sensor3}{{1.1}{4}{Notes}{section*.12}{}}
+\newlabel{EV3:source.EV3.sensor4}{{1.1}{4}{Notes}{section*.13}{}}
+\newlabel{EV3:source.EV3.debug}{{1.1}{4}{Notes}{section*.14}{}}
+\newlabel{EV3:source.EV3.batteryMode}{{1.1}{4}{Notes}{section*.15}{}}
+\newlabel{EV3:source.EV3.batteryValue}{{1.1}{4}{Notes}{section*.16}{}}
+\newlabel{EV3:source.EV3.isConnected}{{1.1}{4}{Notes}{section*.17}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{4}{paragraph*.18}}
+\newlabel{EV3:source.EV3.beep}{{1.1}{4}{Example}{section*.19}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{4}{paragraph*.20}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{4}{paragraph*.21}}
-\newlabel{source:source.EV3.connect}{{1}{4}{Examples}{section*.22}{}}
-\@writefile{toc}{\contentsline {paragraph}{Examples}{4}{paragraph*.23}}
-\newlabel{source:source.EV3.disconnect}{{1}{4}{Examples}{section*.24}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{4}{paragraph*.25}}
+\newlabel{EV3:source.EV3.connect}{{1.1}{4}{Example}{section*.22}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.23}}
+\newlabel{EV3:source.EV3.disconnect}{{1.1}{5}{Example}{section*.24}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{5}{paragraph*.25}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.26}}
-\newlabel{source:source.EV3.playTone}{{1}{5}{Examples}{section*.27}{}}
+\newlabel{EV3:source.EV3.playTone}{{1.1}{5}{Example}{section*.27}{}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.28}}
-\newlabel{source:source.EV3.setProperties}{{1}{5}{Examples}{section*.29}{}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.30}}
-\newlabel{source:source.EV3.stopAllMotors}{{1}{5}{Examples}{section*.31}{}}
-\newlabel{source:source.EV3.stopTone}{{1}{5}{Examples}{section*.32}{}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.33}}
-\newlabel{source:source.EV3.tonePlayed}{{1}{5}{Examples}{section*.34}{}}
-\@writefile{toc}{\contentsline {chapter}{\numberline {2}Motor}{7}{chapter.2}}
-\@writefile{lof}{\addvspace {10\p@ }}
-\@writefile{lot}{\addvspace {10\p@ }}
-\@writefile{loliteral-block}{\addvspace {10\p@ }}
-\newlabel{source:motor}{{2}{7}{Motor}{chapter.2}{}}
-\newlabel{source:source.Motor}{{2}{7}{Motor}{section*.35}{}}
+\newlabel{EV3:source.EV3.setProperties}{{1.1}{5}{Example}{section*.29}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{6}{paragraph*.30}}
+\newlabel{EV3:source.EV3.stopTone}{{1.1}{6}{Example}{section*.31}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{6}{paragraph*.32}}
+\newlabel{EV3:source.EV3.tonePlayed}{{1.1}{6}{Example}{section*.33}{}}
+\newlabel{Motor:module-source}{{1.1}{6}{EV3}{section*.34}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.2}Motor}{6}{section.1.2}}
+\newlabel{Motor::doc}{{1.2}{6}{Motor}{section.1.2}{}}
+\newlabel{Motor:motor}{{1.2}{6}{Motor}{section.1.2}{}}
+\newlabel{Motor:source.Motor}{{1.2}{6}{Motor}{section*.35}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{7}{paragraph*.36}}
-\newlabel{source:source.Motor.power}{{2}{7}{Notes}{section*.37}{}}
-\newlabel{source:source.Motor.speedRegulation}{{2}{7}{Notes}{section*.38}{}}
-\newlabel{source:source.Motor.smoothStart}{{2}{7}{Notes}{section*.39}{}}
-\newlabel{source:source.Motor.smoothStop}{{2}{7}{Notes}{section*.40}{}}
-\newlabel{source:source.Motor.limitValue}{{2}{7}{Notes}{section*.41}{}}
-\newlabel{source:source.Motor.limitMode}{{2}{7}{Notes}{section*.42}{}}
-\newlabel{source:source.Motor.brakeMode}{{2}{7}{Notes}{section*.43}{}}
-\newlabel{source:source.Motor.debug}{{2}{8}{Notes}{section*.44}{}}
-\newlabel{source:source.Motor.isRunning}{{2}{8}{Notes}{section*.45}{}}
-\newlabel{source:source.Motor.tachoCount}{{2}{8}{Notes}{section*.46}{}}
-\newlabel{source:source.Motor.currentSpeed}{{2}{8}{Notes}{section*.47}{}}
-\newlabel{source:source.Motor.type}{{2}{8}{Notes}{section*.48}{}}
-\newlabel{source:source.Motor.internalReset}{{2}{8}{Notes}{section*.49}{}}
+\newlabel{Motor:source.Motor.power}{{1.2}{7}{Notes}{section*.37}{}}
+\newlabel{Motor:source.Motor.speedRegulation}{{1.2}{7}{Notes}{section*.38}{}}
+\newlabel{Motor:source.Motor.smoothStart}{{1.2}{7}{Notes}{section*.39}{}}
+\newlabel{Motor:source.Motor.smoothStop}{{1.2}{7}{Notes}{section*.40}{}}
+\newlabel{Motor:source.Motor.limitValue}{{1.2}{7}{Notes}{section*.41}{}}
+\newlabel{Motor:source.Motor.limitMode}{{1.2}{7}{Notes}{section*.42}{}}
+\newlabel{Motor:source.Motor.brakeMode}{{1.2}{7}{Notes}{section*.43}{}}
+\newlabel{Motor:source.Motor.debug}{{1.2}{7}{Notes}{section*.44}{}}
+\newlabel{Motor:source.Motor.isRunning}{{1.2}{7}{Notes}{section*.45}{}}
+\newlabel{Motor:source.Motor.tachoCount}{{1.2}{7}{Notes}{section*.46}{}}
+\newlabel{Motor:source.Motor.currentSpeed}{{1.2}{7}{Notes}{section*.47}{}}
+\newlabel{Motor:source.Motor.type}{{1.2}{7}{Notes}{section*.48}{}}
+\newlabel{Motor:source.Motor.internalReset}{{1.2}{8}{Notes}{section*.49}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{8}{paragraph*.50}}
-\newlabel{source:source.Motor.resetTachoCount}{{2}{8}{Notes}{section*.51}{}}
-\newlabel{source:source.Motor.setBrake}{{2}{8}{Notes}{section*.52}{}}
-\newlabel{source:source.Motor.setProperties}{{2}{8}{Notes}{section*.53}{}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{9}{paragraph*.54}}
-\newlabel{source:source.Motor.start}{{2}{9}{Notes}{section*.55}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{9}{paragraph*.56}}
-\newlabel{source:source.Motor.stop}{{2}{9}{Notes}{section*.57}{}}
-\newlabel{source:source.Motor.syncedStart}{{2}{9}{Notes}{section*.58}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.59}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{10}{paragraph*.60}}
-\newlabel{source:source.Motor.syncedStop}{{2}{10}{Notes}{section*.61}{}}
-\newlabel{source:source.Motor.waitFor}{{2}{10}{Notes}{section*.62}{}}
+\newlabel{Motor:source.Motor.resetTachoCount}{{1.2}{8}{Notes}{section*.51}{}}
+\newlabel{Motor:source.Motor.setBrake}{{1.2}{8}{Notes}{section*.52}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{8}{paragraph*.53}}
+\newlabel{Motor:source.Motor.setProperties}{{1.2}{8}{Notes}{section*.54}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{9}{paragraph*.55}}
+\newlabel{Motor:source.Motor.start}{{1.2}{9}{Notes}{section*.56}{}}
+\newlabel{Motor:source.Motor.stop}{{1.2}{9}{Notes}{section*.57}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{9}{paragraph*.58}}
+\newlabel{Motor:source.Motor.syncedStart}{{1.2}{9}{Notes}{section*.59}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{9}{paragraph*.60}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{9}{paragraph*.61}}
+\newlabel{Motor:source.Motor.syncedStop}{{1.2}{9}{Notes}{section*.62}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.63}}
-\@writefile{toc}{\contentsline {chapter}{\numberline {3}Sensor}{11}{chapter.3}}
-\@writefile{lof}{\addvspace {10\p@ }}
-\@writefile{lot}{\addvspace {10\p@ }}
-\@writefile{loliteral-block}{\addvspace {10\p@ }}
-\newlabel{source:sensor}{{3}{11}{Sensor}{chapter.3}{}}
-\newlabel{source:source.Sensor}{{3}{11}{Sensor}{section*.64}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{11}{paragraph*.65}}
-\newlabel{source:source.Sensor.mode}{{3}{11}{Notes}{section*.66}{}}
-\newlabel{source:source.Sensor.debug}{{3}{13}{Notes}{section*.67}{}}
-\newlabel{source:source.Sensor.value}{{3}{13}{Notes}{section*.68}{}}
-\newlabel{source:source.Sensor.type}{{3}{13}{Notes}{section*.69}{}}
-\newlabel{source:source.Sensor.reset}{{3}{13}{Notes}{section*.70}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{13}{paragraph*.71}}
-\newlabel{source:source.Sensor.setProperties}{{3}{13}{Notes}{section*.72}{}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{14}{paragraph*.73}}
-\@writefile{toc}{\contentsline {chapter}{\numberline {4}Indices and tables}{15}{chapter.4}}
-\@writefile{lof}{\addvspace {10\p@ }}
-\@writefile{lot}{\addvspace {10\p@ }}
-\@writefile{loliteral-block}{\addvspace {10\p@ }}
-\newlabel{index:indices-and-tables}{{4}{15}{Indices and tables}{chapter.4}{}}
-\@writefile{toc}{\contentsline {chapter}{MATLAB Module Index}{17}{section*.74}}
-\@writefile{toc}{\contentsline {chapter}{Index}{19}{section*.75}}
+\newlabel{Motor:source.Motor.waitFor}{{1.2}{10}{Notes}{section*.64}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.65}}
+\newlabel{Sensor:module-source}{{1.2}{10}{Motor}{section*.66}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.3}Sensor}{10}{section.1.3}}
+\newlabel{Sensor:sensor}{{1.3}{10}{Sensor}{section.1.3}{}}
+\newlabel{Sensor::doc}{{1.3}{10}{Sensor}{section.1.3}{}}
+\newlabel{Sensor:source.Sensor}{{1.3}{10}{Sensor}{section*.67}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.68}}
+\newlabel{Sensor:source.Sensor.mode}{{1.3}{10}{Notes}{section*.69}{}}
+\newlabel{Sensor:source.Sensor.debug}{{1.3}{12}{Notes}{section*.70}{}}
+\newlabel{Sensor:source.Sensor.value}{{1.3}{12}{Notes}{section*.71}{}}
+\newlabel{Sensor:source.Sensor.type}{{1.3}{12}{Notes}{section*.72}{}}
+\newlabel{Sensor:source.Sensor.reset}{{1.3}{13}{Notes}{section*.73}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{13}{paragraph*.74}}
+\newlabel{Sensor:source.Sensor.setProperties}{{1.3}{13}{Notes}{section*.75}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{13}{paragraph*.76}}
+\newlabel{hid:module-source}{{1.3}{13}{Sensor}{section*.77}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.4}hidapi}{13}{section.1.4}}
+\newlabel{hid:hidapi}{{1.4}{13}{hidapi}{section.1.4}{}}
+\newlabel{hid::doc}{{1.4}{13}{hidapi}{section.1.4}{}}
+\newlabel{hid:source.hidapi}{{1.4}{13}{hidapi}{section*.78}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{14}{paragraph*.79}}
+\newlabel{hid:source.hidapi.handle}{{1.4}{14}{Notes}{section*.80}{}}
+\newlabel{hid:source.hidapi.vendorID}{{1.4}{14}{Notes}{section*.81}{}}
+\newlabel{hid:source.hidapi.productID}{{1.4}{14}{Notes}{section*.82}{}}
+\newlabel{hid:source.hidapi.nReadBuffer}{{1.4}{14}{Notes}{section*.83}{}}
+\newlabel{hid:source.hidapi.nWriteBuffer}{{1.4}{14}{Notes}{section*.84}{}}
+\newlabel{hid:source.hidapi.slib}{{1.4}{14}{Notes}{section*.85}{}}
+\newlabel{hid:source.hidapi.sheader}{{1.4}{14}{Notes}{section*.86}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{14}{paragraph*.87}}
+\newlabel{hid:source.hidapi.close}{{1.4}{14}{Example}{section*.88}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.89}}
+\newlabel{hid:source.hidapi.enumerate}{{1.4}{15}{Example}{section*.90}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.91}}
+\newlabel{hid:source.hidapi.error}{{1.4}{15}{Example}{section*.92}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.93}}
+\newlabel{hid:source.hidapi.exit}{{1.4}{15}{Example}{section*.94}{}}
+\newlabel{hid:source.hidapi.getHIDInfoString}{{1.4}{15}{Example}{section*.95}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.96}}
+\newlabel{hid:source.hidapi.getManufacturersString}{{1.4}{16}{Example}{section*.97}{}}
+\newlabel{hid:source.hidapi.getProductString}{{1.4}{16}{Example}{section*.98}{}}
+\newlabel{hid:source.hidapi.getSerialNumberString}{{1.4}{16}{Example}{section*.99}{}}
+\newlabel{hid:source.hidapi.init}{{1.4}{16}{Example}{section*.100}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{16}{paragraph*.101}}
+\newlabel{hid:source.hidapi.open}{{1.4}{16}{Example}{section*.102}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{16}{paragraph*.103}}
+\newlabel{hid:source.hidapi.read}{{1.4}{16}{Example}{section*.104}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{16}{paragraph*.105}}
+\newlabel{hid:source.hidapi.read_timeout}{{1.4}{16}{Example}{section*.106}{}}
+\newlabel{hid:source.hidapi.setNonBlocking}{{1.4}{17}{Example}{section*.107}{}}
+\newlabel{hid:source.hidapi.write}{{1.4}{17}{Example}{section*.108}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{17}{paragraph*.109}}
+\newlabel{usbBrickIO:module-source}{{1.4}{17}{hidapi}{section*.110}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.5}usbBrickIO}{17}{section.1.5}}
+\newlabel{usbBrickIO:usbbrickio}{{1.5}{17}{usbBrickIO}{section.1.5}{}}
+\newlabel{usbBrickIO::doc}{{1.5}{17}{usbBrickIO}{section.1.5}{}}
+\newlabel{usbBrickIO:source.usbBrickIO}{{1.5}{17}{usbBrickIO}{section*.111}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{17}{paragraph*.112}}
+\newlabel{usbBrickIO:source.usbBrickIO.debug}{{1.5}{18}{Notes}{section*.113}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.vendorID}{{1.5}{18}{Notes}{section*.114}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.productID}{{1.5}{18}{Notes}{section*.115}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.nReadBuffer}{{1.5}{18}{Notes}{section*.116}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.nWriteBuffer}{{1.5}{18}{Notes}{section*.117}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.timeOut}{{1.5}{18}{Notes}{section*.118}{}}
+\@writefile{toc}{\contentsline {paragraph}{Examples}{18}{paragraph*.119}}
+\newlabel{usbBrickIO:source.usbBrickIO.close}{{1.5}{18}{Examples}{section*.120}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.open}{{1.5}{18}{Examples}{section*.121}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.read}{{1.5}{18}{Examples}{section*.122}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.setProperties}{{1.5}{18}{Examples}{section*.123}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.write}{{1.5}{18}{Examples}{section*.124}{}}
+\newlabel{btBrickIO:module-source}{{1.5}{18}{usbBrickIO}{section*.125}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.6}btBrickIO}{18}{section.1.6}}
+\newlabel{btBrickIO:btbrickio}{{1.6}{18}{btBrickIO}{section.1.6}{}}
+\newlabel{btBrickIO::doc}{{1.6}{18}{btBrickIO}{section.1.6}{}}
+\newlabel{btBrickIO:source.btBrickIO}{{1.6}{18}{btBrickIO}{section*.126}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{19}{paragraph*.127}}
+\newlabel{btBrickIO:source.btBrickIO.debug}{{1.6}{19}{Notes}{section*.128}{}}
+\newlabel{btBrickIO:source.btBrickIO.serialPort}{{1.6}{19}{Notes}{section*.129}{}}
+\newlabel{btBrickIO:source.btBrickIO.deviceName}{{1.6}{19}{Notes}{section*.130}{}}
+\newlabel{btBrickIO:source.btBrickIO.channel}{{1.6}{19}{Notes}{section*.131}{}}
+\newlabel{btBrickIO:source.btBrickIO.timeOut}{{1.6}{19}{Notes}{section*.132}{}}
+\newlabel{btBrickIO:source.btBrickIO.backend}{{1.6}{19}{Notes}{section*.133}{}}
+\@writefile{toc}{\contentsline {paragraph}{Examples}{19}{paragraph*.134}}
+\newlabel{btBrickIO:source.btBrickIO.close}{{1.6}{19}{Examples}{section*.135}{}}
+\newlabel{btBrickIO:source.btBrickIO.open}{{1.6}{19}{Examples}{section*.136}{}}
+\newlabel{btBrickIO:source.btBrickIO.read}{{1.6}{19}{Examples}{section*.137}{}}
+\newlabel{btBrickIO:source.btBrickIO.setProperties}{{1.6}{19}{Examples}{section*.138}{}}
+\newlabel{btBrickIO:source.btBrickIO.write}{{1.6}{20}{Examples}{section*.139}{}}
+\@writefile{toc}{\contentsline {chapter}{MATLAB Module Index}{21}{section*.140}}
+\@writefile{toc}{\contentsline {chapter}{Index}{23}{section*.141}}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.idx b/docs/_build/latex/MindstormsEV3Toolbox.idx
index 98c686c0bd1abd79fc87c4aadf12116d7a15ef13..745e18b4d43d3681b6ad13aceb5030142ae75d7a 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.idx
+++ b/docs/_build/latex/MindstormsEV3Toolbox.idx
@@ -1,26 +1,26 @@
-\indexentry{source (module)|hyperpage}{1}
+\indexentry{source (module)|hyperpage}{3}
 \indexentry{EV3 (class in source)|hyperpage}{3}
 \indexentry{motorA (source.EV3 attribute)|hyperpage}{3}
 \indexentry{motorB (source.EV3 attribute)|hyperpage}{3}
 \indexentry{motorC (source.EV3 attribute)|hyperpage}{3}
-\indexentry{motorD (source.EV3 attribute)|hyperpage}{3}
-\indexentry{sensor1 (source.EV3 attribute)|hyperpage}{3}
-\indexentry{sensor2 (source.EV3 attribute)|hyperpage}{3}
-\indexentry{sensor3 (source.EV3 attribute)|hyperpage}{3}
-\indexentry{sensor4 (source.EV3 attribute)|hyperpage}{3}
-\indexentry{debug (source.EV3 attribute)|hyperpage}{3}
-\indexentry{batteryMode (source.EV3 attribute)|hyperpage}{3}
+\indexentry{motorD (source.EV3 attribute)|hyperpage}{4}
+\indexentry{sensor1 (source.EV3 attribute)|hyperpage}{4}
+\indexentry{sensor2 (source.EV3 attribute)|hyperpage}{4}
+\indexentry{sensor3 (source.EV3 attribute)|hyperpage}{4}
+\indexentry{sensor4 (source.EV3 attribute)|hyperpage}{4}
+\indexentry{debug (source.EV3 attribute)|hyperpage}{4}
+\indexentry{batteryMode (source.EV3 attribute)|hyperpage}{4}
 \indexentry{batteryValue (source.EV3 attribute)|hyperpage}{4}
 \indexentry{isConnected (source.EV3 attribute)|hyperpage}{4}
 \indexentry{beep() (source.EV3 method)|hyperpage}{4}
 \indexentry{connect() (source.EV3 method)|hyperpage}{4}
-\indexentry{disconnect() (source.EV3 method)|hyperpage}{4}
+\indexentry{disconnect() (source.EV3 method)|hyperpage}{5}
 \indexentry{playTone() (source.EV3 method)|hyperpage}{5}
 \indexentry{setProperties() (source.EV3 method)|hyperpage}{5}
-\indexentry{stopAllMotors() (source.EV3 method)|hyperpage}{5}
-\indexentry{stopTone() (source.EV3 method)|hyperpage}{5}
-\indexentry{tonePlayed() (source.EV3 method)|hyperpage}{5}
-\indexentry{Motor (class in source)|hyperpage}{7}
+\indexentry{stopTone() (source.EV3 method)|hyperpage}{6}
+\indexentry{tonePlayed() (source.EV3 method)|hyperpage}{6}
+\indexentry{source (module)|hyperpage}{6}
+\indexentry{Motor (class in source)|hyperpage}{6}
 \indexentry{power (source.Motor attribute)|hyperpage}{7}
 \indexentry{speedRegulation (source.Motor attribute)|hyperpage}{7}
 \indexentry{smoothStart (source.Motor attribute)|hyperpage}{7}
@@ -28,11 +28,11 @@
 \indexentry{limitValue (source.Motor attribute)|hyperpage}{7}
 \indexentry{limitMode (source.Motor attribute)|hyperpage}{7}
 \indexentry{brakeMode (source.Motor attribute)|hyperpage}{7}
-\indexentry{debug (source.Motor attribute)|hyperpage}{8}
-\indexentry{isRunning (source.Motor attribute)|hyperpage}{8}
-\indexentry{tachoCount (source.Motor attribute)|hyperpage}{8}
-\indexentry{currentSpeed (source.Motor attribute)|hyperpage}{8}
-\indexentry{type (source.Motor attribute)|hyperpage}{8}
+\indexentry{debug (source.Motor attribute)|hyperpage}{7}
+\indexentry{isRunning (source.Motor attribute)|hyperpage}{7}
+\indexentry{tachoCount (source.Motor attribute)|hyperpage}{7}
+\indexentry{currentSpeed (source.Motor attribute)|hyperpage}{7}
+\indexentry{type (source.Motor attribute)|hyperpage}{7}
 \indexentry{internalReset() (source.Motor method)|hyperpage}{8}
 \indexentry{resetTachoCount() (source.Motor method)|hyperpage}{8}
 \indexentry{setBrake() (source.Motor method)|hyperpage}{8}
@@ -40,12 +40,62 @@
 \indexentry{start() (source.Motor method)|hyperpage}{9}
 \indexentry{stop() (source.Motor method)|hyperpage}{9}
 \indexentry{syncedStart() (source.Motor method)|hyperpage}{9}
-\indexentry{syncedStop() (source.Motor method)|hyperpage}{10}
+\indexentry{syncedStop() (source.Motor method)|hyperpage}{9}
 \indexentry{waitFor() (source.Motor method)|hyperpage}{10}
-\indexentry{Sensor (class in source)|hyperpage}{11}
-\indexentry{mode (source.Sensor attribute)|hyperpage}{11}
-\indexentry{debug (source.Sensor attribute)|hyperpage}{13}
-\indexentry{value (source.Sensor attribute)|hyperpage}{13}
-\indexentry{type (source.Sensor attribute)|hyperpage}{13}
+\indexentry{source (module)|hyperpage}{10}
+\indexentry{Sensor (class in source)|hyperpage}{10}
+\indexentry{mode (source.Sensor attribute)|hyperpage}{10}
+\indexentry{debug (source.Sensor attribute)|hyperpage}{12}
+\indexentry{value (source.Sensor attribute)|hyperpage}{12}
+\indexentry{type (source.Sensor attribute)|hyperpage}{12}
 \indexentry{reset() (source.Sensor method)|hyperpage}{13}
 \indexentry{setProperties() (source.Sensor method)|hyperpage}{13}
+\indexentry{source (module)|hyperpage}{13}
+\indexentry{hidapi (class in source)|hyperpage}{13}
+\indexentry{handle (source.hidapi attribute)|hyperpage}{14}
+\indexentry{vendorID (source.hidapi attribute)|hyperpage}{14}
+\indexentry{productID (source.hidapi attribute)|hyperpage}{14}
+\indexentry{nReadBuffer (source.hidapi attribute)|hyperpage}{14}
+\indexentry{nWriteBuffer (source.hidapi attribute)|hyperpage}{14}
+\indexentry{slib (source.hidapi attribute)|hyperpage}{14}
+\indexentry{sheader (source.hidapi attribute)|hyperpage}{14}
+\indexentry{close() (source.hidapi method)|hyperpage}{14}
+\indexentry{enumerate() (source.hidapi method)|hyperpage}{15}
+\indexentry{error() (source.hidapi method)|hyperpage}{15}
+\indexentry{exit() (source.hidapi method)|hyperpage}{15}
+\indexentry{getHIDInfoString() (source.hidapi method)|hyperpage}{15}
+\indexentry{getManufacturersString() (source.hidapi method)|hyperpage}{16}
+\indexentry{getProductString() (source.hidapi method)|hyperpage}{16}
+\indexentry{getSerialNumberString() (source.hidapi method)|hyperpage}{16}
+\indexentry{init() (source.hidapi method)|hyperpage}{16}
+\indexentry{open() (source.hidapi method)|hyperpage}{16}
+\indexentry{read() (source.hidapi method)|hyperpage}{16}
+\indexentry{read\_timeout() (source.hidapi method)|hyperpage}{16}
+\indexentry{setNonBlocking() (source.hidapi method)|hyperpage}{17}
+\indexentry{write() (source.hidapi method)|hyperpage}{17}
+\indexentry{source (module)|hyperpage}{17}
+\indexentry{usbBrickIO (class in source)|hyperpage}{17}
+\indexentry{debug (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{vendorID (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{productID (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{nReadBuffer (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{nWriteBuffer (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{timeOut (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{close() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{open() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{read() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{setProperties() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{write() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{source (module)|hyperpage}{18}
+\indexentry{btBrickIO (class in source)|hyperpage}{18}
+\indexentry{debug (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{serialPort (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{deviceName (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{channel (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{timeOut (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{backend (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{close() (source.btBrickIO method)|hyperpage}{19}
+\indexentry{open() (source.btBrickIO method)|hyperpage}{19}
+\indexentry{read() (source.btBrickIO method)|hyperpage}{19}
+\indexentry{setProperties() (source.btBrickIO method)|hyperpage}{19}
+\indexentry{write() (source.btBrickIO method)|hyperpage}{20}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.ilg b/docs/_build/latex/MindstormsEV3Toolbox.ilg
index 7d5536a42b0ade2ea375b5d1036cae12c13df867..60f413b091ff0bf7a9aeb2be5b65009b8d773fba 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.ilg
+++ b/docs/_build/latex/MindstormsEV3Toolbox.ilg
@@ -1,7 +1,7 @@
 This is makeindex, version 2.15 [TeX Live 2013] (kpathsea + Thai support).
 Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored).
-Scanning input file MindstormsEV3Toolbox.idx....done (51 entries accepted, 0 rejected).
-Sorting entries....done (302 comparisons).
-Generating output file MindstormsEV3Toolbox.ind....done (93 lines written, 0 warnings).
+Scanning input file MindstormsEV3Toolbox.idx....done (101 entries accepted, 0 rejected).
+Sorting entries....done (719 comparisons).
+Generating output file MindstormsEV3Toolbox.ind....done (154 lines written, 0 warnings).
 Output written in MindstormsEV3Toolbox.ind.
 Transcript written in MindstormsEV3Toolbox.ilg.
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.ind b/docs/_build/latex/MindstormsEV3Toolbox.ind
index 3d4ec788e9e897c77a88239b7291e51b6aec717a..b53cd6c775f17167217b499b2a98aa5a9039f20f 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.ind
+++ b/docs/_build/latex/MindstormsEV3Toolbox.ind
@@ -2,32 +2,57 @@
 \def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
 
   \bigletter B
-  \item batteryMode (source.EV3 attribute), \hyperpage{3}
+  \item backend (source.btBrickIO attribute), \hyperpage{19}
+  \item batteryMode (source.EV3 attribute), \hyperpage{4}
   \item batteryValue (source.EV3 attribute), \hyperpage{4}
   \item beep() (source.EV3 method), \hyperpage{4}
   \item brakeMode (source.Motor attribute), \hyperpage{7}
+  \item btBrickIO (class in source), \hyperpage{18}
 
   \indexspace
   \bigletter C
+  \item channel (source.btBrickIO attribute), \hyperpage{19}
+  \item close() (source.btBrickIO method), \hyperpage{19}
+  \item close() (source.hidapi method), \hyperpage{14}
+  \item close() (source.usbBrickIO method), \hyperpage{18}
   \item connect() (source.EV3 method), \hyperpage{4}
-  \item currentSpeed (source.Motor attribute), \hyperpage{8}
+  \item currentSpeed (source.Motor attribute), \hyperpage{7}
 
   \indexspace
   \bigletter D
-  \item debug (source.EV3 attribute), \hyperpage{3}
-  \item debug (source.Motor attribute), \hyperpage{8}
-  \item debug (source.Sensor attribute), \hyperpage{13}
-  \item disconnect() (source.EV3 method), \hyperpage{4}
+  \item debug (source.btBrickIO attribute), \hyperpage{19}
+  \item debug (source.EV3 attribute), \hyperpage{4}
+  \item debug (source.Motor attribute), \hyperpage{7}
+  \item debug (source.Sensor attribute), \hyperpage{12}
+  \item debug (source.usbBrickIO attribute), \hyperpage{18}
+  \item deviceName (source.btBrickIO attribute), \hyperpage{19}
+  \item disconnect() (source.EV3 method), \hyperpage{5}
 
   \indexspace
   \bigletter E
+  \item enumerate() (source.hidapi method), \hyperpage{15}
+  \item error() (source.hidapi method), \hyperpage{15}
   \item EV3 (class in source), \hyperpage{3}
+  \item exit() (source.hidapi method), \hyperpage{15}
+
+  \indexspace
+  \bigletter G
+  \item getHIDInfoString() (source.hidapi method), \hyperpage{15}
+  \item getManufacturersString() (source.hidapi method), \hyperpage{16}
+  \item getProductString() (source.hidapi method), \hyperpage{16}
+  \item getSerialNumberString() (source.hidapi method), \hyperpage{16}
+
+  \indexspace
+  \bigletter H
+  \item handle (source.hidapi attribute), \hyperpage{14}
+  \item hidapi (class in source), \hyperpage{13}
 
   \indexspace
   \bigletter I
+  \item init() (source.hidapi method), \hyperpage{16}
   \item internalReset() (source.Motor method), \hyperpage{8}
   \item isConnected (source.EV3 attribute), \hyperpage{4}
-  \item isRunning (source.Motor attribute), \hyperpage{8}
+  \item isRunning (source.Motor attribute), \hyperpage{7}
 
   \indexspace
   \bigletter L
@@ -36,58 +61,94 @@
 
   \indexspace
   \bigletter M
-  \item mode (source.Sensor attribute), \hyperpage{11}
-  \item Motor (class in source), \hyperpage{7}
+  \item mode (source.Sensor attribute), \hyperpage{10}
+  \item Motor (class in source), \hyperpage{6}
   \item motorA (source.EV3 attribute), \hyperpage{3}
   \item motorB (source.EV3 attribute), \hyperpage{3}
   \item motorC (source.EV3 attribute), \hyperpage{3}
-  \item motorD (source.EV3 attribute), \hyperpage{3}
+  \item motorD (source.EV3 attribute), \hyperpage{4}
+
+  \indexspace
+  \bigletter N
+  \item nReadBuffer (source.hidapi attribute), \hyperpage{14}
+  \item nReadBuffer (source.usbBrickIO attribute), \hyperpage{18}
+  \item nWriteBuffer (source.hidapi attribute), \hyperpage{14}
+  \item nWriteBuffer (source.usbBrickIO attribute), \hyperpage{18}
+
+  \indexspace
+  \bigletter O
+  \item open() (source.btBrickIO method), \hyperpage{19}
+  \item open() (source.hidapi method), \hyperpage{16}
+  \item open() (source.usbBrickIO method), \hyperpage{18}
 
   \indexspace
   \bigletter P
   \item playTone() (source.EV3 method), \hyperpage{5}
   \item power (source.Motor attribute), \hyperpage{7}
+  \item productID (source.hidapi attribute), \hyperpage{14}
+  \item productID (source.usbBrickIO attribute), \hyperpage{18}
 
   \indexspace
   \bigletter R
+  \item read() (source.btBrickIO method), \hyperpage{19}
+  \item read() (source.hidapi method), \hyperpage{16}
+  \item read() (source.usbBrickIO method), \hyperpage{18}
+  \item read\_timeout() (source.hidapi method), \hyperpage{16}
   \item reset() (source.Sensor method), \hyperpage{13}
   \item resetTachoCount() (source.Motor method), \hyperpage{8}
 
   \indexspace
   \bigletter S
-  \item Sensor (class in source), \hyperpage{11}
-  \item sensor1 (source.EV3 attribute), \hyperpage{3}
-  \item sensor2 (source.EV3 attribute), \hyperpage{3}
-  \item sensor3 (source.EV3 attribute), \hyperpage{3}
-  \item sensor4 (source.EV3 attribute), \hyperpage{3}
+  \item Sensor (class in source), \hyperpage{10}
+  \item sensor1 (source.EV3 attribute), \hyperpage{4}
+  \item sensor2 (source.EV3 attribute), \hyperpage{4}
+  \item sensor3 (source.EV3 attribute), \hyperpage{4}
+  \item sensor4 (source.EV3 attribute), \hyperpage{4}
+  \item serialPort (source.btBrickIO attribute), \hyperpage{19}
   \item setBrake() (source.Motor method), \hyperpage{8}
+  \item setNonBlocking() (source.hidapi method), \hyperpage{17}
+  \item setProperties() (source.btBrickIO method), \hyperpage{19}
   \item setProperties() (source.EV3 method), \hyperpage{5}
   \item setProperties() (source.Motor method), \hyperpage{8}
   \item setProperties() (source.Sensor method), \hyperpage{13}
+  \item setProperties() (source.usbBrickIO method), \hyperpage{18}
+  \item sheader (source.hidapi attribute), \hyperpage{14}
+  \item slib (source.hidapi attribute), \hyperpage{14}
   \item smoothStart (source.Motor attribute), \hyperpage{7}
   \item smoothStop (source.Motor attribute), \hyperpage{7}
-  \item source (module), \hyperpage{1}
+  \item source (module), \hyperpage{3}, \hyperpage{6}, \hyperpage{10}, \hyperpage{13}, 
+		\hyperpage{17, 18}
   \item speedRegulation (source.Motor attribute), \hyperpage{7}
   \item start() (source.Motor method), \hyperpage{9}
   \item stop() (source.Motor method), \hyperpage{9}
-  \item stopAllMotors() (source.EV3 method), \hyperpage{5}
-  \item stopTone() (source.EV3 method), \hyperpage{5}
+  \item stopTone() (source.EV3 method), \hyperpage{6}
   \item syncedStart() (source.Motor method), \hyperpage{9}
-  \item syncedStop() (source.Motor method), \hyperpage{10}
+  \item syncedStop() (source.Motor method), \hyperpage{9}
 
   \indexspace
   \bigletter T
-  \item tachoCount (source.Motor attribute), \hyperpage{8}
-  \item tonePlayed() (source.EV3 method), \hyperpage{5}
-  \item type (source.Motor attribute), \hyperpage{8}
-  \item type (source.Sensor attribute), \hyperpage{13}
+  \item tachoCount (source.Motor attribute), \hyperpage{7}
+  \item timeOut (source.btBrickIO attribute), \hyperpage{19}
+  \item timeOut (source.usbBrickIO attribute), \hyperpage{18}
+  \item tonePlayed() (source.EV3 method), \hyperpage{6}
+  \item type (source.Motor attribute), \hyperpage{7}
+  \item type (source.Sensor attribute), \hyperpage{12}
+
+  \indexspace
+  \bigletter U
+  \item usbBrickIO (class in source), \hyperpage{17}
 
   \indexspace
   \bigletter V
-  \item value (source.Sensor attribute), \hyperpage{13}
+  \item value (source.Sensor attribute), \hyperpage{12}
+  \item vendorID (source.hidapi attribute), \hyperpage{14}
+  \item vendorID (source.usbBrickIO attribute), \hyperpage{18}
 
   \indexspace
   \bigletter W
   \item waitFor() (source.Motor method), \hyperpage{10}
+  \item write() (source.btBrickIO method), \hyperpage{20}
+  \item write() (source.hidapi method), \hyperpage{17}
+  \item write() (source.usbBrickIO method), \hyperpage{18}
 
 \end{theindex}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.log b/docs/_build/latex/MindstormsEV3Toolbox.log
index a90b8fa9d53e3ce191957ec6edfe1518389f5d2f..0071761bcf09fd733c10e23dee7fec894af4fc52 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.log
+++ b/docs/_build/latex/MindstormsEV3Toolbox.log
@@ -1,4 +1,4 @@
-This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2016.11.23)  13 DEC 2016 18:45
+This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2016.11.23)  15 AUG 2017 19:10
 entering extended mode
  restricted \write18 enabled.
  %&-line parsing enabled.
@@ -1000,79 +1000,82 @@ LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <10> not available
 ]
 Chapter 1.
 LaTeX Font Info:    Font shape `T1/phv/bx/n' in size <14.4> not available
-(Font)              Font shape `T1/phv/b/n' tried instead on input line 150.
+(Font)              Font shape `T1/phv/b/n' tried instead on input line 152.
 LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <14.4> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 150.
+(Font)              Font shape `T1/ptm/b/n' tried instead on input line 152.
 LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <24.88> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 150.
+(Font)              Font shape `T1/ptm/b/n' tried instead on input line 152.
 LaTeX Font Info:    Try loading font information for T1+pcr on input line 1.
 (/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pcr.fd
 File: t1pcr.fd 2001/06/04 font definitions for T1/pcr.
 )
 LaTeX Font Info:    Font shape `T1/pcr/bx/n' in size <10> not available
 (Font)              Font shape `T1/pcr/b/n' tried instead on input line 1.
-LaTeX Font Info:    Try loading font information for TS1+ptm on input line 162.
+LaTeX Font Info:    Font shape `T1/ptm/bx/it' in size <10> not available
+(Font)              Font shape `T1/ptm/b/it' tried instead on input line 162.
+LaTeX Font Info:    Try loading font information for TS1+ptm on input line 163.
 
 
 (/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd
 File: ts1ptm.fd 2001/06/04 font definitions for TS1/ptm.
-) [3]
+)
 LaTeX Font Info:    Font shape `T1/pcr/m/it' in size <10> not available
-(Font)              Font shape `T1/pcr/m/sl' tried instead on input line 315.
-
-Underfull \hbox (badness 10000) in paragraph at lines 318--320
+(Font)              Font shape `T1/pcr/m/sl' tried instead on input line 1.
+ [3] [4]
+Underfull \hbox (badness 10000) in paragraph at lines 359--361
 []\T1/pcr/b/n/10 serPort \T1/ptm/m/n/10 (\T1/pcr/m/sl/10 string in {'/dev/rfcom
 m1', '/dev/rfcomm2', ...}\T1/ptm/m/n/10 ) --
  []
 
-[4]
-Underfull \hbox (badness 10000) in paragraph at lines 401--402
+
+Underfull \hbox (badness 10000) in paragraph at lines 445--446
 []\T1/pcr/b/n/10 batteryMode \T1/ptm/m/n/10 (\T1/pcr/m/sl/10 string in {'Voltag
 e'/'Percentage'}\T1/ptm/m/n/10 ) -- see
  []
 
-[5] [6
+[5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
+Underfull \hbox (badness 10000) in paragraph at lines 1549--1551
+[]\T1/ptm/m/n/10 See also HI-DAPI.GETMANUFACTURERSSTRING, HI-DAPI.GETPRODUCTSTR
+ING, HI-
+ []
 
-]
-Chapter 2.
-[7] [8] [9] [10]
-Chapter 3.
-[11
+[15] [16] [17] [18] [19]
+Underfull \hbox (badness 5504) in paragraph at lines 2024--2026
+[]\T1/ptm/m/n/10 See also BT-BRICKIO.DEBUG, BT-BRICKIO.SERIALPORT, BT-BRICKIO.D
+EVICENAME, BT-
+ []
 
-] [12] [13] [14]
-Chapter 4.
-[15
+[20] [21
 
-] [16
 
-] [17
 
+] (./MindstormsEV3Toolbox.ind [22
 
-] (./MindstormsEV3Toolbox.ind [18
 
+] [23
 
-] [19
+] [24
 
 ])
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1256.
-Package atveryend Info: Empty hook `AfterLastShipout' on input line 1256.
+Package atveryend Info: Empty hook `BeforeClearDocument' on input line 2056.
+Package atveryend Info: Empty hook `AfterLastShipout' on input line 2056.
 
 (./MindstormsEV3Toolbox.aux)
-Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1256.
-Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1256.
+Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 2056.
+Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 2056.
 
 Package rerunfilecheck Info: File `MindstormsEV3Toolbox.out' has not changed.
-(rerunfilecheck)             Checksum: E100CA1E8BEC3FF034AB7A951CE1136C;554.
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1256.
+(rerunfilecheck)             Checksum: 9719E66C3E78A64D7D70223B0833B074;820.
+Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 2056.
  ) 
 Here is how much of TeX's memory you used:
- 13363 strings out of 493304
- 182319 string characters out of 6139870
- 269862 words of memory out of 5000000
- 16432 multiletter control sequences out of 15000+600000
- 49812 words of font info for 63 fonts, out of 8000000 for 9000
+ 13536 strings out of 493304
+ 185311 string characters out of 6139870
+ 273034 words of memory out of 5000000
+ 16512 multiletter control sequences out of 15000+600000
+ 53871 words of font info for 71 fonts, out of 8000000 for 9000
  958 hyphenation exceptions out of 8191
- 36i,12n,45p,266b,712s stack positions out of 5000i,500n,10000p,200000b,80000s
+ 36i,12n,45p,527b,671s stack positions out of 5000i,500n,10000p,200000b,80000s
 {/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}</usr/share/texliv
 e/texmf-dist/fonts/type1/urw/courier/ucrb8a.pfb></usr/share/texlive/texmf-dist/
 fonts/type1/urw/courier/ucrr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/u
@@ -1080,12 +1083,13 @@ rw/courier/ucrro8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/
 uhvb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvbo8a.pfb>
 </usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb></usr/share/
 texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb></usr/share/texlive/texmf-d
-ist/fonts/type1/urw/times/utmr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1
-/urw/times/utmri8a.pfb>
-Output written on MindstormsEV3Toolbox.pdf (23 pages, 136359 bytes).
+ist/fonts/type1/urw/times/utmbi8a.pfb></usr/share/texlive/texmf-dist/fonts/type
+1/urw/times/utmr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utm
+ri8a.pfb>
+Output written on MindstormsEV3Toolbox.pdf (28 pages, 172860 bytes).
 PDF statistics:
- 326 PDF objects out of 1000 (max. 8388607)
- 284 compressed objects within 3 object streams
- 103 named destinations out of 1000 (max. 500000)
- 69 words of extra memory for PDF output out of 10000 (max. 10000000)
+ 565 PDF objects out of 1000 (max. 8388607)
+ 514 compressed objects within 6 object streams
+ 180 named destinations out of 1000 (max. 500000)
+ 93 words of extra memory for PDF output out of 10000 (max. 10000000)
 
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.out b/docs/_build/latex/MindstormsEV3Toolbox.out
index 78857ab8b77c95e044761a73c34086a3e149f2cb..22711f503c315e66f6cf13d69f069b33c3e64502 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.out
+++ b/docs/_build/latex/MindstormsEV3Toolbox.out
@@ -1,6 +1,9 @@
-\BOOKMARK [0][-]{chapter.1}{\376\377\000E\000V\0003}{}% 1
-\BOOKMARK [0][-]{chapter.2}{\376\377\000M\000o\000t\000o\000r}{}% 2
-\BOOKMARK [0][-]{chapter.3}{\376\377\000S\000e\000n\000s\000o\000r}{}% 3
-\BOOKMARK [0][-]{chapter.4}{\376\377\000I\000n\000d\000i\000c\000e\000s\000\040\000a\000n\000d\000\040\000t\000a\000b\000l\000e\000s}{}% 4
-\BOOKMARK [0][-]{section*.74}{\376\377\000M\000A\000T\000L\000A\000B\000\040\000M\000o\000d\000u\000l\000e\000\040\000I\000n\000d\000e\000x}{}% 5
-\BOOKMARK [0][-]{section*.75}{\376\377\000I\000n\000d\000e\000x}{}% 6
+\BOOKMARK [0][-]{chapter.1}{\376\377\000C\000o\000n\000t\000e\000n\000t\000s}{}% 1
+\BOOKMARK [1][-]{section.1.1}{\376\377\000E\000V\0003}{chapter.1}% 2
+\BOOKMARK [1][-]{section.1.2}{\376\377\000M\000o\000t\000o\000r}{chapter.1}% 3
+\BOOKMARK [1][-]{section.1.3}{\376\377\000S\000e\000n\000s\000o\000r}{chapter.1}% 4
+\BOOKMARK [1][-]{section.1.4}{\376\377\000h\000i\000d\000a\000p\000i}{chapter.1}% 5
+\BOOKMARK [1][-]{section.1.5}{\376\377\000u\000s\000b\000B\000r\000i\000c\000k\000I\000O}{chapter.1}% 6
+\BOOKMARK [1][-]{section.1.6}{\376\377\000b\000t\000B\000r\000i\000c\000k\000I\000O}{chapter.1}% 7
+\BOOKMARK [0][-]{section*.140}{\376\377\000M\000A\000T\000L\000A\000B\000\040\000M\000o\000d\000u\000l\000e\000\040\000I\000n\000d\000e\000x}{}% 8
+\BOOKMARK [0][-]{section*.141}{\376\377\000I\000n\000d\000e\000x}{}% 9
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.pdf b/docs/_build/latex/MindstormsEV3Toolbox.pdf
index 8c116599065d13e5ffbae9aa15afeadfdb2b9938..64c49bfd6bd2fad0db48d27192caf8c1c3a17138 100644
Binary files a/docs/_build/latex/MindstormsEV3Toolbox.pdf and b/docs/_build/latex/MindstormsEV3Toolbox.pdf differ
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.tex b/docs/_build/latex/MindstormsEV3Toolbox.tex
index ad54ed4e1a71d77f41f4f6431e8a090faba5d0f2..6cf917ea3ef6ba93136fdcfdcaba0ff04acd98e2 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.tex
+++ b/docs/_build/latex/MindstormsEV3Toolbox.tex
@@ -28,12 +28,12 @@
 
 \addto\extrasenglish{\def\pageautorefname{page}}
 
-\setcounter{tocdepth}{3}
+\setcounter{tocdepth}{1}
 
 
 \title{Mindstorms EV3 Toolbox Documentation}
-\date{Dec 13, 2016}
-\release{v0.4-rc.10}
+\date{Aug 15, 2017}
+\release{v1.0}
 \author{LfB - RWTH Aachen}
 \newcommand{\sphinxlogo}{}
 \renewcommand{\releasename}{Release}
@@ -144,14 +144,50 @@
 \phantomsection\label{index::doc}
 
 
-Contents:
-\phantomsection\label{source:module-source}\index{source (module)}
+Hi there! This is the documentation for the ``Lego Mindstorms EV3'' MATLAB Toolbox,
+developed by RWTH Aachen. For an introduction about this toolbox, installation
+guides and examples, take a look at \href{https://git.rwth-aachen.de/mindstorms/ev3-toolbox-matlab/blob/master/readme.md}{our repository}.
 
-\chapter{EV3}
-\label{source:ev3}\label{source::doc}\label{source:toolbox-for-controlling-lego-mindstorms-ev3-with-matlab}\index{EV3 (class in source)}
+
+\chapter{Contents}
+\label{index:our-repository}\label{index:contents}\label{index:matlab-toolbox-for-controlling-lego-mindstorms-ev3}
+High-Level documentation
+\phantomsection\label{EV3:module-source}\index{source (module)}
+
+\section{EV3}
+\label{EV3:ev3}\label{EV3::doc}\index{EV3 (class in source)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{EV3}}{\emph{varargin}}{}
+\phantomsection\label{EV3:source.EV3}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{EV3}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+\sphinxcode{connect()}
+
+\item {} 
+\sphinxcode{disconnect()}
+
+\item {} 
+\sphinxcode{stopAllMotors()}
+
+\item {} 
+\sphinxcode{beep()}
+
+\item {} 
+\sphinxcode{playTone()}
+
+\item {} 
+\sphinxcode{stopTone()}
+
+\item {} 
+\sphinxcode{tonePlayed()}
+
+\item {} 
+\sphinxcode{setProperties()}
+
+\end{itemize}
+
+\end{description}
+
 High-level class to work with physical bricks.
 
 This is the `central' class (from user's view) when working with this toolbox. It
@@ -163,75 +199,81 @@ commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for eac
 Creating multiple EV3 objects and connecting them to different physical bricks has not
 been thoroughly tested yet, but seems to work on a first glance.
 
+\item {} 
+When an input argument of a method is marked as optional, the argument needs to be
+`announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: \emph{brickObject.motorA.setProperties(`power', 50);}
+
 \end{itemize}
 \index{motorA (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.motorA}\pysigline{\sphinxbfcode{motorA}}
-\emph{Motor} -- Motor-object interfacing port A
+\phantomsection\label{EV3:source.EV3.motorA}\pysigline{\sphinxbfcode{motorA}}
+\emph{Motor} -- Motor-object interfacing port A. See also {\hyperref[Motor:source.Motor]{\sphinxcrossref{\sphinxcode{Motor}}}}.
 
 \end{fulllineitems}
 
 \index{motorB (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.motorB}\pysigline{\sphinxbfcode{motorB}}
-\emph{Motor} -- Motor-object interfacing port B
+\phantomsection\label{EV3:source.EV3.motorB}\pysigline{\sphinxbfcode{motorB}}
+\emph{Motor} -- Motor-object interfacing port B. See also {\hyperref[Motor:source.Motor]{\sphinxcrossref{\sphinxcode{Motor}}}}.
 
 \end{fulllineitems}
 
 \index{motorC (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.motorC}\pysigline{\sphinxbfcode{motorC}}
-\emph{Motor} -- Motor-object interfacing port C
+\phantomsection\label{EV3:source.EV3.motorC}\pysigline{\sphinxbfcode{motorC}}
+\emph{Motor} -- Motor-object interfacing port C. See also {\hyperref[Motor:source.Motor]{\sphinxcrossref{\sphinxcode{Motor}}}}.
 
 \end{fulllineitems}
 
 \index{motorD (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.motorD}\pysigline{\sphinxbfcode{motorD}}
-\emph{Motor} -- Motor-object interfacing port D
+\phantomsection\label{EV3:source.EV3.motorD}\pysigline{\sphinxbfcode{motorD}}
+\emph{Motor} -- Motor-object interfacing port D. See also {\hyperref[Motor:source.Motor]{\sphinxcrossref{\sphinxcode{Motor}}}}.
 
 \end{fulllineitems}
 
 \index{sensor1 (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.sensor1}\pysigline{\sphinxbfcode{sensor1}}
-\emph{Sensor} -- Motor-object interfacing port 1
+\phantomsection\label{EV3:source.EV3.sensor1}\pysigline{\sphinxbfcode{sensor1}}
+\emph{Sensor} -- Motor-object interfacing port 1. See also {\hyperref[Sensor:source.Sensor]{\sphinxcrossref{\sphinxcode{Sensor}}}}.
 
 \end{fulllineitems}
 
 \index{sensor2 (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.sensor2}\pysigline{\sphinxbfcode{sensor2}}
-\emph{Sensor} -- Motor-object interfacing port 2
+\phantomsection\label{EV3:source.EV3.sensor2}\pysigline{\sphinxbfcode{sensor2}}
+\emph{Sensor} -- Motor-object interfacing port 2. See also {\hyperref[Sensor:source.Sensor]{\sphinxcrossref{\sphinxcode{Sensor}}}}.
 
 \end{fulllineitems}
 
 \index{sensor3 (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.sensor3}\pysigline{\sphinxbfcode{sensor3}}
-\emph{Sensor} -- Motor-object interfacing port 3
+\phantomsection\label{EV3:source.EV3.sensor3}\pysigline{\sphinxbfcode{sensor3}}
+\emph{Sensor} -- Motor-object interfacing port 3. See also {\hyperref[Sensor:source.Sensor]{\sphinxcrossref{\sphinxcode{Sensor}}}}.
 
 \end{fulllineitems}
 
 \index{sensor4 (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.sensor4}\pysigline{\sphinxbfcode{sensor4}}
-\emph{Sensor} -- Motor-object interfacing port 4
+\phantomsection\label{EV3:source.EV3.sensor4}\pysigline{\sphinxbfcode{sensor4}}
+\emph{Sensor} -- Motor-object interfacing port 4. See also {\hyperref[Sensor:source.Sensor]{\sphinxcrossref{\sphinxcode{Sensor}}}}.
 
 \end{fulllineitems}
 
 \index{debug (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.debug}\pysigline{\sphinxbfcode{debug}}
+\phantomsection\label{EV3:source.EV3.debug}\pysigline{\sphinxbfcode{debug}}
 \emph{numeric in \{0,1,2\}} -- Debug mode. \emph{{[}WRITABLE{]}}
 \begin{itemize}
 \item {} 
@@ -250,64 +292,63 @@ been thoroughly tested yet, but seems to work on a first glance.
 \index{batteryMode (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.batteryMode}\pysigline{\sphinxbfcode{batteryMode}}
-\emph{string in \{`Percentage', `Voltage'\}} -- Mode for reading battery charge.
-\emph{{[}WRITABLE{]}}
+\phantomsection\label{EV3:source.EV3.batteryMode}\pysigline{\sphinxbfcode{batteryMode}}
+\emph{string in \{`Percentage', `Voltage'\}} -- Mode for reading battery charge. See also \sphinxcode{batteryValue}. \emph{{[}WRITABLE{]}}
 
 \end{fulllineitems}
 
 \index{batteryValue (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.batteryValue}\pysigline{\sphinxbfcode{batteryValue}}
-\emph{numeric} -- Current battery charge. Depending on batteryMode, the reading
-is either in percentage or voltage. \emph{{[}READ-ONLY{]}}
+\phantomsection\label{EV3:source.EV3.batteryValue}\pysigline{\sphinxbfcode{batteryValue}}
+\emph{numeric} -- Current battery charge. Depending on batteryMode, the reading is either in percentage or voltage. See also \sphinxcode{batteryMode}. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
 
 \index{isConnected (source.EV3 attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.isConnected}\pysigline{\sphinxbfcode{isConnected}}
+\phantomsection\label{EV3:source.EV3.isConnected}\pysigline{\sphinxbfcode{isConnected}}
 \emph{bool} -- True if virtual brick-object is connected to physical one. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
 
-\paragraph{Examples}
+\paragraph{Example}
 
-b = EV3(); 
-b.connect(`usb'); 
-ma = b.motorA; 
-ma.setProperties(`power', 50, `limitValue', 720); 
-ma.start(); 
+\% This example expects a motor at port A and a (random) sensor at port 1 
+b = EV3(); \% 
+b.connect(`usb'); \% 
+ma = b.motorA; \% 
+ma.setProperties(`power', 50, `limitValue', 720); \% 
+ma.start(); \% 
 \% fun 
-b.sensor1.value 
-b.waitFor(); 
-b.beep(); 
-delete b; 
+ma.waitFor(); \% 
+disp(b.sensor1.value); \% 
+b.beep(); \% 
+delete b; \% 
 \index{beep() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.beep}\pysiglinewithargsret{\sphinxbfcode{beep}}{\emph{ev3}}{}
+\phantomsection\label{EV3:source.EV3.beep}\pysiglinewithargsret{\sphinxbfcode{beep}}{\emph{ev3}}{}
 Plays a `beep'-tone on brick.
 \paragraph{Notes}
 \begin{itemize}
 \item {} 
-This equals playTone(10, 1000, 100) (Wraps the same opCode in comm-layer)
+This equals playTone(10, 1000, 100).
 
 \end{itemize}
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
-b.beep(); 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
+b.beep(); \% 
 
 \end{fulllineitems}
 
 \index{connect() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.connect}\pysiglinewithargsret{\sphinxbfcode{connect}}{\emph{ev3}, \emph{varargin}}{}
+\phantomsection\label{EV3:source.EV3.connect}\pysiglinewithargsret{\sphinxbfcode{connect}}{\emph{ev3}, \emph{varargin}}{}
 Connects EV3-object and its Motors and Sensors to physical brick.
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode\begin{itemize}
@@ -316,31 +357,31 @@ Connects EV3-object and its Motors and Sensors to physical brick.
 
 \item {} 
 \textbf{\texttt{serPort}} (\emph{\texttt{string in \{'/dev/rfcomm1', '/dev/rfcomm2', ...\}}}) -- Path to serial port
-(if `bt')
+(necessary if connectionType is `bt'). \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{beep}} (\emph{\texttt{bool}}) -- If true, EV3 beeps if connection has been established
+\textbf{\texttt{beep}} (\emph{\texttt{bool}}) -- If true, EV3 beeps if connection has been established. \emph{{[}OPTIONAL{]}}
 
 \end{itemize}
 
 \end{description}\end{quote}
-\paragraph{Examples}
+\paragraph{Example}
 
 \% Setup bluetooth connection via com-port 0 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
 \% Setup usb connection, beep when connection has been established
-b = EV3(); 
-b.connect(`usb', `beep', `on', ); 
+b = EV3(); \% 
+b.connect(`usb', `beep', `on', ); \% 
 
-Check connection
+See also ISCONNECTED / \sphinxcode{isConnected}
 
 \end{fulllineitems}
 
 \index{disconnect() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.disconnect}\pysiglinewithargsret{\sphinxbfcode{disconnect}}{\emph{ev3}}{}
+\phantomsection\label{EV3:source.EV3.disconnect}\pysiglinewithargsret{\sphinxbfcode{disconnect}}{\emph{ev3}}{}
 Disconnects EV3-object and its Motors and Sensors from physical brick.
 \paragraph{Notes}
 \begin{itemize}
@@ -350,19 +391,22 @@ Gets called automatically when EV3-object is destroyed.
 \end{itemize}
 \paragraph{Example}
 
-b = EV3();
-b.connect(`bt', `serPort', `/dev/rfcomm0');
-\% do stuff
-b.disconnect();
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
+\% do stuff 
+b.disconnect(); \% 
 
-Reset motors and sensors before disconnecting
+Resetting needs a working connection in order to send reset-commands
+to the Brick. If the connection has been aborted (e.g. by pulling the
+USB-cord), the reset-methods would fail -\textgreater{} catch this error and for
+now do nothing.
 
 \end{fulllineitems}
 
 \index{playTone() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.playTone}\pysiglinewithargsret{\sphinxbfcode{playTone}}{\emph{ev3}, \emph{volume}, \emph{frequency}, \emph{duration}}{}
+\phantomsection\label{EV3:source.EV3.playTone}\pysiglinewithargsret{\sphinxbfcode{playTone}}{\emph{ev3}, \emph{volume}, \emph{frequency}, \emph{duration}}{}
 Plays tone on brick.
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode\begin{itemize}
@@ -373,15 +417,15 @@ Plays tone on brick.
 \textbf{\texttt{frequency}} (\emph{\texttt{numeric in {[}250, 10000{]}}}) -- in Hertz
 
 \item {} 
-\textbf{\texttt{duration}} (\emph{\texttt{numeric \textgreater{}0}}) -- in milliseconds
+\textbf{\texttt{duration}} (\emph{\texttt{numeric \textgreater{} 0}}) -- in milliseconds
 
 \end{itemize}
 
 \end{description}\end{quote}
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
 b.playTone(40, 5000, 1000);  \% Plays tone with 40\% volume and 5000Hz for 1
 second. 
 
@@ -390,7 +434,7 @@ second.
 \index{setProperties() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{ev3}, \emph{varargin}}{}
+\phantomsection\label{EV3:source.EV3.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{ev3}, \emph{varargin}}{}
 Set multiple EV3 properties at once using MATLAB's inputParser.
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode\begin{itemize}
@@ -405,32 +449,24 @@ Set multiple EV3 properties at once using MATLAB's inputParser.
 \end{description}\end{quote}
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
-b.setProperties(`debug', `on', `batteryMode', `Voltage'); 
-\% Instead of: b.debug = `on'; b.batteryMode = `Voltage'; 
-
-See also EV3.DEBUG, EV3.BATTERYMODE
-
-\end{fulllineitems}
-
-\index{stopAllMotors() (source.EV3 method)}
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
+b.setProperties(`debug', `on', `batteryMode', `Voltage'); \% 
+\% Instead of: b.debug = `on'; b.batteryMode = `Voltage'; \% 
 
-\begin{fulllineitems}
-\phantomsection\label{source:source.EV3.stopAllMotors}\pysiglinewithargsret{\sphinxbfcode{stopAllMotors}}{\emph{ev3}}{}
-Sends a stop-command to all motor-ports
+See also EV3.DEBUG, EV3.BATTERYMODE / \sphinxcode{debug}, \sphinxcode{batteryMode}
 
 \end{fulllineitems}
 
 \index{stopTone() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.stopTone}\pysiglinewithargsret{\sphinxbfcode{stopTone}}{\emph{ev3}}{}
-Stops tone currently played
+\phantomsection\label{EV3:source.EV3.stopTone}\pysiglinewithargsret{\sphinxbfcode{stopTone}}{\emph{ev3}}{}
+Stops tone currently played.
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
 b.playTone(10,100,100000000);  \% Accidentally given wrong tone duration :) 
 b.stopTone();  \% Stops tone immediately. 
 
@@ -439,7 +475,7 @@ b.stopTone();  \% Stops tone immediately.
 \index{tonePlayed() (source.EV3 method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.EV3.tonePlayed}\pysiglinewithargsret{\sphinxbfcode{tonePlayed}}{\emph{ev3}}{}
+\phantomsection\label{EV3:source.EV3.tonePlayed}\pysiglinewithargsret{\sphinxbfcode{tonePlayed}}{\emph{ev3}}{}
 Tests if tone is currently played.
 \begin{quote}\begin{description}
 \item[{Returns}] \leavevmode
@@ -451,11 +487,11 @@ bool
 \end{description}\end{quote}
 \begin{description}
 \item[{Example}] \leavevmode
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
-b.playTone(10, 100, 1000); 
-pause(0.5); 
-b.tonePlayed() -\textgreater{} Outputs 1 to console. 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
+b.playTone(10, 100, 1000); \% 
+pause(0.5); \% Small pause is necessary as tone does not start instantaneously 
+b.tonePlayed(); \% -\textgreater{} Outputs 1 to console.  
 
 \end{description}
 
@@ -464,13 +500,45 @@ b.tonePlayed() -\textgreater{} Outputs 1 to console.
 
 \end{fulllineitems}
 
+\phantomsection\label{Motor:module-source}\index{source (module)}
 
-
-\chapter{Motor}
-\label{source:motor}\index{Motor (class in source)}
+\section{Motor}
+\label{Motor::doc}\label{Motor:motor}\index{Motor (class in source)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Motor}}{\emph{varargin}}{}
+\phantomsection\label{Motor:source.Motor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Motor}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[Motor:source.Motor.start]{\sphinxcrossref{\sphinxcode{start()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.stop]{\sphinxcrossref{\sphinxcode{stop()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.syncedStart]{\sphinxcrossref{\sphinxcode{syncedStart()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.syncedStop]{\sphinxcrossref{\sphinxcode{syncedStop()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.waitFor]{\sphinxcrossref{\sphinxcode{waitFor()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.internalReset]{\sphinxcrossref{\sphinxcode{internalReset()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.resetTachoCount]{\sphinxcrossref{\sphinxcode{resetTachoCount()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.setBrake]{\sphinxcrossref{\sphinxcode{setBrake()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
 High-level class to work with motors.
 
 This class is supposed to ease the use of the brick's motors. It is possible to set all
@@ -489,11 +557,17 @@ The Motor-class represents motor ports, not individual motors!
 If you start a motor with power=0, the internal state will still be set to
 `isRunning'
 
+\item {} 
+When an input argument of a method is marked as optional, the argument needs to be
+`announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: \emph{brickObject.motorA.setProperties(`power', 50);}
+
 \end{itemize}
 \index{power (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.power}\pysigline{\sphinxbfcode{power}}
+\phantomsection\label{Motor:source.Motor.power}\pysigline{\sphinxbfcode{power}}
 \emph{numeric in {[}-100, 100{]}} -- Power level of motor in percent. \emph{{[}WRITABLE{]}}
 
 \end{fulllineitems}
@@ -501,11 +575,11 @@ If you start a motor with power=0, the internal state will still be set to
 \index{speedRegulation (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.speedRegulation}\pysigline{\sphinxbfcode{speedRegulation}}
+\phantomsection\label{Motor:source.Motor.speedRegulation}\pysigline{\sphinxbfcode{speedRegulation}}
 \emph{bool} -- Speed regulation turned on or off. When turned on, motor will
 try to `hold' its speed at given power level, whatever the load. In this mode, the
 highest possible speed depends on the load and mostly goes up to around 70-80 (at
-this point, the Brick internally input 100\% power). When turned off, motor will
+this point, the Brick internally inputs 100\% power). When turned off, motor will
 constantly input the same power into the motor. The resulting speed will be
 somewhat lower, depending on the load. \emph{{[}WRITABLE{]}}
 
@@ -514,49 +588,49 @@ somewhat lower, depending on the load. \emph{{[}WRITABLE{]}}
 \index{smoothStart (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.smoothStart}\pysigline{\sphinxbfcode{smoothStart}}
+\phantomsection\label{Motor:source.Motor.smoothStart}\pysigline{\sphinxbfcode{smoothStart}}
 \emph{numeric s. t. smoothStart+smoothStop \textless{} limitValue} -- Degrees/Time
 indicating how far/long the motor should smoothly start. Depending on limitMode,
 the input is interpreted either in degrees or milliseconds. The first
 \{smoothStart\}-milliseconds/degrees of limitValue the motor will slowly accelerate
-until reaching its defined speed. \emph{{[}WRITABLE{]}}
+until reaching its defined speed. See also {\hyperref[Motor:source.Motor.limitValue]{\sphinxcrossref{\sphinxcode{limitValue}}}}, {\hyperref[Motor:source.Motor.limitMode]{\sphinxcrossref{\sphinxcode{limitMode}}}}. \emph{{[}WRITABLE{]}}
 
 \end{fulllineitems}
 
 \index{smoothStop (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.smoothStop}\pysigline{\sphinxbfcode{smoothStop}}
+\phantomsection\label{Motor:source.Motor.smoothStop}\pysigline{\sphinxbfcode{smoothStop}}
 \emph{numeric s. t. smoothStart+smoothStop \textless{} limitValue} -- Degrees/Time
 indicating how far/long the motor should smoothly stop. Depending on limitMode, the
 input is interpreted either in degrees or milliseconds. The last
 {[}smoothStop{]}-milliseconds/degrees of limitValue the motor will slowly slow down
-until it has stopped. \emph{{[}WRITABLE{]}}
+until it has stopped. See also {\hyperref[Motor:source.Motor.limitValue]{\sphinxcrossref{\sphinxcode{limitValue}}}}, {\hyperref[Motor:source.Motor.limitMode]{\sphinxcrossref{\sphinxcode{limitMode}}}}. \emph{{[}WRITABLE{]}}
 
 \end{fulllineitems}
 
 \index{limitValue (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.limitValue}\pysigline{\sphinxbfcode{limitValue}}
+\phantomsection\label{Motor:source.Motor.limitValue}\pysigline{\sphinxbfcode{limitValue}}
 \emph{numeric\textgreater{}=0} -- Degrees/Time indicating how far/long the motor should run.
 Depending on limitMode, the input is interpreted either in degrees or
-milliseconds. \emph{{[}WRITABLE{]}}
+milliseconds. See also {\hyperref[Motor:source.Motor.limitMode]{\sphinxcrossref{\sphinxcode{limitMode}}}}. \emph{{[}WRITABLE{]}}
 
 \end{fulllineitems}
 
 \index{limitMode (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.limitMode}\pysigline{\sphinxbfcode{limitMode}}
-\emph{`Tacho'\textbar{}'Time'} -- Mode for motor limit. \emph{{[}WRITABLE{]}}
+\phantomsection\label{Motor:source.Motor.limitMode}\pysigline{\sphinxbfcode{limitMode}}
+\emph{`Tacho'\textbar{}'Time'} -- Mode for motor limit. See also {\hyperref[Motor:source.Motor.limitValue]{\sphinxcrossref{\sphinxcode{limitValue}}}}. \emph{{[}WRITABLE{]}}
 
 \end{fulllineitems}
 
 \index{brakeMode (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.brakeMode}\pysigline{\sphinxbfcode{brakeMode}}
+\phantomsection\label{Motor:source.Motor.brakeMode}\pysigline{\sphinxbfcode{brakeMode}}
 \emph{`Brake'\textbar{}'Coast'} -- Action done when stopping. If `Coast', the motor will (at
 tacholimit, if \textasciitilde{}=0) coast to a stop. If `Brake', the motor will stop immediately
 (at tacholimit, if \textasciitilde{}=0) and hold the brake. \emph{{[}WRITABLE{]}}
@@ -566,7 +640,7 @@ tacholimit, if \textasciitilde{}=0) coast to a stop. If `Brake', the motor will
 \index{debug (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.debug}\pysigline{\sphinxbfcode{debug}}
+\phantomsection\label{Motor:source.Motor.debug}\pysigline{\sphinxbfcode{debug}}
 \emph{bool} -- Debug turned on or off. In debug mode, everytime a command is passed to
 the sublayer (`communication layer'), there is feedback in the console about what
 command has been called. \emph{{[}WRITABLE{]}}
@@ -576,7 +650,7 @@ command has been called. \emph{{[}WRITABLE{]}}
 \index{isRunning (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.isRunning}\pysigline{\sphinxbfcode{isRunning}}
+\phantomsection\label{Motor:source.Motor.isRunning}\pysigline{\sphinxbfcode{isRunning}}
 \emph{bool} -- True if motor is running. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
@@ -584,24 +658,24 @@ command has been called. \emph{{[}WRITABLE{]}}
 \index{tachoCount (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.tachoCount}\pysigline{\sphinxbfcode{tachoCount}}
-\emph{numeric} -- Current tacho count. \emph{{[}READ-ONLY{]}}
+\phantomsection\label{Motor:source.Motor.tachoCount}\pysigline{\sphinxbfcode{tachoCount}}
+\emph{numeric} -- Current tacho count in degrees. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
 
 \index{currentSpeed (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.currentSpeed}\pysigline{\sphinxbfcode{currentSpeed}}
+\phantomsection\label{Motor:source.Motor.currentSpeed}\pysigline{\sphinxbfcode{currentSpeed}}
 \emph{numeric} -- Current speed of motor. If speedRegulation=on this should equal power,
-otherwise it will probably be lower than that. \emph{{[}READ-ONLY{]}}
+otherwise it will probably be lower than that. See also {\hyperref[Motor:source.Motor.speedRegulation]{\sphinxcrossref{\sphinxcode{speedRegulation}}}}. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
 
 \index{type (source.Motor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.type}\pysigline{\sphinxbfcode{type}}
+\phantomsection\label{Motor:source.Motor.type}\pysigline{\sphinxbfcode{type}}
 \emph{DeviceType} -- Type of connected device if any. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
@@ -609,9 +683,9 @@ otherwise it will probably be lower than that. \emph{{[}READ-ONLY{]}}
 \index{internalReset() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.internalReset}\pysiglinewithargsret{\sphinxbfcode{internalReset}}{\emph{motor}}{}
+\phantomsection\label{Motor:source.Motor.internalReset}\pysiglinewithargsret{\sphinxbfcode{internalReset}}{\emph{motor}}{}
 Resets internal tacho count. Use this if motor behaves weird (i.e. not starting at all, or not correctly
-running to limitValue)
+running to limitValue).
 
 The internal tacho count is used for positioning the motor. When the
 motor is running with a tacho limit, internally it uses another counter than the
@@ -624,79 +698,88 @@ brakemode is `Coast', this function is called automatically.
 A better name would probably be resetPosition...
 
 \item {} 
-Gets called automatically when starting the motor and the internal tacho
+Gets called automatically when starting the motor and the internal tacho count is \textgreater{} 0
 
 \end{itemize}
 
-count is \textgreater{} 0
-
-See also MOTOR.RESETTACHOCOUNT
+See also MOTOR.RESETTACHOCOUNT / {\hyperref[Motor:source.Motor.resetTachoCount]{\sphinxcrossref{\sphinxcode{resetTachoCount}}}}
 
 \end{fulllineitems}
 
 \index{resetTachoCount() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.resetTachoCount}\pysiglinewithargsret{\sphinxbfcode{resetTachoCount}}{\emph{motor}}{}
-Resets tachocount
+\phantomsection\label{Motor:source.Motor.resetTachoCount}\pysiglinewithargsret{\sphinxbfcode{resetTachoCount}}{\emph{motor}}{}
+Resets tachocount.
+
+See also MOTOR.TACHOCOUNT / {\hyperref[Motor:source.Motor.tachoCount]{\sphinxcrossref{\sphinxcode{tachoCount}}}}
 
 \end{fulllineitems}
 
 \index{setBrake() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.setBrake}\pysiglinewithargsret{\sphinxbfcode{setBrake}}{\emph{motor}, \emph{brake}}{}
-Apply or release brake of motor
+\phantomsection\label{Motor:source.Motor.setBrake}\pysiglinewithargsret{\sphinxbfcode{setBrake}}{\emph{motor}, \emph{brake}}{}
+Apply or release brake of motor.
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode
 \textbf{\texttt{brake}} (\emph{\texttt{bool}}) -- If true, brake will be pulled
 
 \end{description}\end{quote}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+This method does not affect Motor.brakeMode. After the next run, the motor
+will again be stopped as specified in Motor.brakeMode.
+
+\end{itemize}
+
+See also MOTOR.BRAKEMODE / {\hyperref[Motor:source.Motor.brakeMode]{\sphinxcrossref{\sphinxcode{brakeMode}}}}
 
 \end{fulllineitems}
 
 \index{setProperties() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{motor}, \emph{varargin}}{}
+\phantomsection\label{Motor:source.Motor.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{motor}, \emph{varargin}}{}
 Sets multiple Motor properties at once using MATLAB's inputParser.
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode\begin{itemize}
 \item {} 
-\textbf{\texttt{debug}} (\emph{\texttt{bool}}) -- 
+\textbf{\texttt{debug}} (\emph{\texttt{bool}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{smoothStart}} (\emph{\texttt{numeric in {[}0, limitValue{]}}}) -- 
+\textbf{\texttt{smoothStart}} (\emph{\texttt{numeric in {[}0, limitValue{]}}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{smoothStop}} (\emph{\texttt{numeric in {[}0, limitValue{]}}}) -- 
+\textbf{\texttt{smoothStop}} (\emph{\texttt{numeric in {[}0, limitValue{]}}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{speedRegulation}} (\emph{\texttt{bool}}) -- 
+\textbf{\texttt{speedRegulation}} (\emph{\texttt{bool}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{brakeMode}} (\emph{\texttt{'Coast'\textbar{}'Brake'}}) -- 
+\textbf{\texttt{brakeMode}} (\emph{\texttt{'Coast'\textbar{}'Brake'}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{limitMode}} (\emph{\texttt{'Time'\textbar{}'Tacho'}}) -- 
+\textbf{\texttt{limitMode}} (\emph{\texttt{'Time'\textbar{}'Tacho'}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{limitValue}} (\emph{\texttt{numeric \textgreater{} 0}}) -- 
+\textbf{\texttt{limitValue}} (\emph{\texttt{numeric \textgreater{} 0}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{power}} (\emph{\texttt{numeric in {[}-100,100{]}}}) -- 
+\textbf{\texttt{power}} (\emph{\texttt{numeric in {[}-100,100{]}}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{batteryMode}} (\emph{\texttt{'Voltage'\textbar{}'Percentage'}}) -- 
+\textbf{\texttt{batteryMode}} (\emph{\texttt{'Voltage'\textbar{}'Percentage'}}) -- \emph{{[}OPTIONAL{]}}
 
 \end{itemize}
 
 \end{description}\end{quote}
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
-b.motorA.setProperties(`debug', `on', `power', 50, `limitValue', 720, `speedRegulation', `on'); 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
+b.motorA.setProperties(`debug', `on', `power', 50, `limitValue', 720, `speedRegulation', `on'); \% 
 \% Instead of: b.motorA.debug = `on'; 
 \%             b.motorA.power = 50; 
 \%             b.motorA.limitValue = 720; 
@@ -707,88 +790,60 @@ b.motorA.setProperties(`debug', `on', `power', 50, `limitValue', 720, `speedRegu
 \index{start() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.start}\pysiglinewithargsret{\sphinxbfcode{start}}{\emph{motor}}{}
-Starts the motor
-\paragraph{Notes}
-\begin{itemize}
-\item {} 
-Right now, alternatingly calling this function with and without tacho limit
-may lead to unexpected behaviour. For example, if you run the motor without
-a tacholimit for some time using Coast, then stop using Coast, and then try
-to run the with a tacholimit, it will stop sooner or later than expected,
-or may not even start at all.
-
-\item {} 
-(OLD)After calling one of the functions to control the motor with some kind of
-limit (which is done if limit\textasciitilde{}=0), the physical brick's power/speed value for
-starting without a limit (i.e. if limit==0) is reset to zero. So if you want
-to control the motor without a limit after doing so with a limit, you would
-have to set the power manually to the desired value again. (I don't really
-know if this is deliberate or a bug, and at this point, I'm too afraid to ask.)
-To avoid confusion, this is done automatically in this special case.
-However, this does not even work all the time. If motor does not
-start, call stop() and setPower() manually. :/
-
-\end{itemize}
-
-Check connection and if motor is already running
+\phantomsection\label{Motor:source.Motor.start}\pysiglinewithargsret{\sphinxbfcode{start}}{\emph{motor}}{}
+Starts the motor.
 
 \end{fulllineitems}
 
 \index{stop() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.stop}\pysiglinewithargsret{\sphinxbfcode{stop}}{\emph{motor}}{}
-Stops the motor
+\phantomsection\label{Motor:source.Motor.stop}\pysiglinewithargsret{\sphinxbfcode{stop}}{\emph{motor}}{}
+Stops the motor.
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+If this motor has been started synced with another one (either as master or
+slave, using Motor.syncedStart), syncedStop() will be called, stopping both
+motors.
+
+\end{itemize}
+
+See also MOTOR.START, MOTOR.SYNCEDSTOP / {\hyperref[Motor:source.Motor.start]{\sphinxcrossref{\sphinxcode{start()}}}}, {\hyperref[Motor:source.Motor.syncedStop]{\sphinxcrossref{\sphinxcode{syncedStop()}}}}
 
 \end{fulllineitems}
 
 \index{syncedStart() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.syncedStart}\pysiglinewithargsret{\sphinxbfcode{syncedStart}}{\emph{motor}, \emph{syncMotor}, \emph{varargin}}{}
-Starts this motor synchronized with another
-
-This motor acts as a `master', meaning that the synchronized control is done via
-this one. When syncedStart is called, the master sets some of the slave's
-(syncMotor) properties to keep it consistent with the physical brick. So, for
-example, changing the power on the master motor will take effect
-on the slave as soon as this method is called.
-The following parameters will be affected on the slave: power, brakeMode,
-limitValue, speedRegulation
+\phantomsection\label{Motor:source.Motor.syncedStart}\pysiglinewithargsret{\sphinxbfcode{syncedStart}}{\emph{motor}, \emph{syncMotor}, \emph{varargin}}{}
+Starts this motor synchronized with another.
+
+The motor, with which this method is called, acts as a \emph{master}, meaning that the
+synchronized control is done with it und uses its parameters. When syncedStart is
+called, the master sets some of the slave's (syncMotor) properties to keep it
+consistent with the physical brick. So, for example, if the master has another
+power-value than the slave, the slave's power-value will be set to that of the
+master when syncedStart() is called.
+The following parameters will be affected on the slave: \emph{power}, \emph{brakeMode},
+\emph{limitValue}, \emph{speedRegulation}
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode\begin{itemize}
 \item {} 
-\textbf{\texttt{syncMotor}} (\emph{\texttt{Motor}}) -- the motor-object to sync with
-
-\item {} 
-\textbf{\texttt{turnRatio}} (\emph{\texttt{numeric in {[}-200,200{]}}}) -- 
-\emph{{[}OPTIONAL{]}}  (Excerpt of Firmware-comments, in c\_output.c):
-``Turn ratio is how tight you turn and to what direction you turn.
-\begin{itemize}
-\item {} 
-0 value is moving straight forward
-
-\item {} 
-Negative values turn to the left
-
-\item {} 
-Positive values turn to the right
-
-\item {} 
-Value -100 stops the left motor
-
-\item {} 
-Value +100 stops the right motor
-
-\item {} 
-Values less than -100 makes the left motor run the opposite direction of the right motor (Spin)
+\textbf{\texttt{syncMotor}} (\emph{\texttt{Motor}}) -- The motor-object to sync with
 
 \item {} 
-Values greater than +100 makes the right motor run the opposite direction of the left motor (Spin)''
-
-\end{itemize}
-
+\textbf{\texttt{turnRatio}} (\emph{\texttt{numeric in {[}-200,200{]}}}) -- Ratio between the two master's and the
+slave's motor speed. With values!=0 one motor will be slower than the other
+or even turn into the other direction. This can be used for turning car-like
+robots, for example. \emph{{[}OPTIONAL{]}} (Read in Firmware-comments in c\_output.c): 
+-\textgreater{} 0 is moving straight forward 
+-\textgreater{} Negative values turn to the left 
+-\textgreater{} Positive values turn to the right 
+-\textgreater{} Value -100 stops the left motor 
+-\textgreater{} Value +100 stops the right motor 
+-\textgreater{} Values less than -100 makes the left motor run the opposite direction of the right motor (Spin) 
+-\textgreater{} Values greater than +100 makes the right motor run the opposite direction of the left motor (Spin) 
 
 \end{itemize}
 
@@ -796,46 +851,52 @@ Values greater than +100 makes the right motor run the opposite direction of the
 \paragraph{Notes}
 \begin{itemize}
 \item {} 
-This is right now a pretty `heavy' function, as it tests if both motors are
-connected AND aren't running, wasting four packets, keep that in mind
-
-\item {} 
-It is necessary to call syncedStop() and not stop() for stopping the motors
-(otherwise the sync-state cannot be exited correctly)
+This is a pretty `heavy' function, as it tests if both motors are
+connected AND aren't running, wasting four packets, keep that in mind.
 
 \end{itemize}
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`usb'); 
-m = b.motorA; 
-slave = b.motorB; 
-m.power = 50; 
-m.syncedStart(slave); 
-\% Do stuff
-m.syncedStop(); 
+b = EV3(); \% 
+b.connect(`usb'); \% 
+m = b.motorA; \% 
+slave = b.motorB; \% 
+m.power = 50; \% 
+m.syncedStart(slave); \% 
+\% Do stuff 
+m.stop(); \% 
+
+See also MOTOR.STOP, MOTOR.SYNCEDSTOP / {\hyperref[Motor:source.Motor.stop]{\sphinxcrossref{\sphinxcode{stop()}}}}, {\hyperref[Motor:source.Motor.syncedStop]{\sphinxcrossref{\sphinxcode{syncedStop()}}}}
 
 \end{fulllineitems}
 
 \index{syncedStop() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.syncedStop}\pysiglinewithargsret{\sphinxbfcode{syncedStop}}{\emph{motor}}{}
+\phantomsection\label{Motor:source.Motor.syncedStop}\pysiglinewithargsret{\sphinxbfcode{syncedStop}}{\emph{motor}}{}
 Stops both motors previously started with syncedStart.
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+This method is called automatically by stop(), if the motors have been
+started using syncedStart, and the regular stop-method has been called afterwards.
 
-See also MOTOR.SYNCEDSTART
+\end{itemize}
+
+See also MOTOR.SYNCEDSTART, MOTOR.STOP / {\hyperref[Motor:source.Motor.syncedStart]{\sphinxcrossref{\sphinxcode{syncedStart()}}}}, {\hyperref[Motor:source.Motor.stop]{\sphinxcrossref{\sphinxcode{stop()}}}}
 
 \end{fulllineitems}
 
 \index{waitFor() (source.Motor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Motor.waitFor}\pysiglinewithargsret{\sphinxbfcode{waitFor}}{\emph{motor}}{}
-Stops execution of program as long as motor is running
+\phantomsection\label{Motor:source.Motor.waitFor}\pysiglinewithargsret{\sphinxbfcode{waitFor}}{\emph{motor}}{}
+Stops execution of program as long as motor is running.
 \paragraph{Notes}
 \begin{itemize}
 \item {} 
-(OLD)This one's a bit tricky. The opCode OutputReady makes the brick stop sending
+This one's a bit tricky. The opCode which is supposed to be used here, OutputReady,
+makes the brick stop sending
 responses until the motor has stopped. For security reasons, in this toolbox
 there is an internal timeout for receiving messages from the brick. It raises
 an error if a reply takes too long, which would happen in this case. As a
@@ -843,15 +904,8 @@ workaround, there is an infinite loop that catches errors from outputReady and
 continues then, until outputReady will actually finish without an error.
 
 \item {} 
-(OLD)OutputReady (like OutputTest in isRunning) sometimes doesn't work. If
-outputReady returns in less than a second, another while-loop iterates until
-the motor has stopped, this time using motor.isRunning() (this only works as
-long as not both OutputTest and OutputReady are buggy).
-
-\item {} 
-(OLD)Workaround: Poll isRunning (which itself return (speed\textgreater{}0)) until it
-is false (No need to check if motor is connected as speed correctly
-returns 0 if it's not)
+Workaround: Poll isRunning until it is false (No need to check if motor is
+connected as speed correctly returns 0 if it's not)
 
 \end{itemize}
 
@@ -860,13 +914,24 @@ returns 0 if it's not)
 
 \end{fulllineitems}
 
+\phantomsection\label{Sensor:module-source}\index{source (module)}
 
-
-\chapter{Sensor}
-\label{source:sensor}\index{Sensor (class in source)}
+\section{Sensor}
+\label{Sensor:sensor}\label{Sensor::doc}\index{Sensor (class in source)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Sensor}}{\emph{varargin}}{}
+\phantomsection\label{Sensor:source.Sensor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Sensor}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[Sensor:source.Sensor.reset]{\sphinxcrossref{\sphinxcode{reset()}}}}
+
+\item {} 
+{\hyperref[Sensor:source.Sensor.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
 High-level class to work with sensors.
 
 The Sensor-class facilitates the communication with sensors. This mainly consists of
@@ -880,16 +945,18 @@ instances for each sensor port, and you can work with them via the EV3-object.
 \item {} 
 The Sensor-class represents sensor ports, not individual sensors!
 
+\item {} 
+When an input argument of a method is marked as optional, the argument needs to be
+`announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+follows: \emph{brickObject.motorA.setProperties(`power', 50);}
+
 \end{itemize}
 \index{mode (source.Sensor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor.mode}\pysigline{\sphinxbfcode{mode}}
-\emph{DeviceMode.\{Type\}} -- Sensor mode in which the value will be read. By default,
-mode is set to DeviceMode.Default.Undefined. Once a physical sensor is connected
-to the port \emph{and} the physical Brick is connected to the EV3-object, the allowed
-mode and the default mode for a Sensor-object are the following (depending on the
-sensor type): \emph{{[}WRITABLE{]}}
+\phantomsection\label{Sensor:source.Sensor.mode}\pysigline{\sphinxbfcode{mode}}
+\emph{DeviceMode.\{Type\}} -- Sensor mode in which the value will be read. By default, mode is set to \emph{DeviceMode.Default.Undefined}. See also {\hyperref[Sensor:source.Sensor.type]{\sphinxcrossref{\sphinxcode{type}}}}. \emph{{[}WRITABLE{]}}  Once a physical sensor is connected to the port \emph{and} the physical Brick is connected to the EV3-object, the allowed mode and the default mode for a Sensor-object are the following (depending on the sensor type):
 \begin{itemize}
 \item {} \begin{description}
 \item[{Touch-Sensor:}] \leavevmode\begin{itemize}
@@ -1102,7 +1169,7 @@ DeviceMode.HTColor.All
 \index{debug (source.Sensor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor.debug}\pysigline{\sphinxbfcode{debug}}
+\phantomsection\label{Sensor:source.Sensor.debug}\pysigline{\sphinxbfcode{debug}}
 \emph{bool} -- Debug turned on or off. In debug mode, everytime a command is passed to
 the sublayer (`communication layer'), there is feedback in the console about what
 command has been called. \emph{{[}WRITABLE{]}}
@@ -1112,16 +1179,16 @@ command has been called. \emph{{[}WRITABLE{]}}
 \index{value (source.Sensor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor.value}\pysigline{\sphinxbfcode{value}}
+\phantomsection\label{Sensor:source.Sensor.value}\pysigline{\sphinxbfcode{value}}
 \emph{numeric} -- Value read from hysical sensor. What the value represents depends on
-sensor.mode. \emph{{[}READ-ONLY{]}}
+{\hyperref[Sensor:source.Sensor.mode]{\sphinxcrossref{\sphinxcode{mode}}}}. \emph{{[}READ-ONLY{]}}
 
 \end{fulllineitems}
 
 \index{type (source.Sensor attribute)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor.type}\pysigline{\sphinxbfcode{type}}
+\phantomsection\label{Sensor:source.Sensor.type}\pysigline{\sphinxbfcode{type}}
 \emph{DeviceType} -- Type of physical sensor connected to the port. Possible types are: {[}READ-ONLY{]}
 \begin{itemize}
 \item {} 
@@ -1188,12 +1255,12 @@ DeviceType.Error
 \index{reset() (source.Sensor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor.reset}\pysiglinewithargsret{\sphinxbfcode{reset}}{\emph{sensor}}{}
-Resets value on sensor
+\phantomsection\label{Sensor:source.Sensor.reset}\pysiglinewithargsret{\sphinxbfcode{reset}}{\emph{sensor}}{}
+Resets sensor value.
 \paragraph{Notes}
 \begin{itemize}
 \item {} 
-This clears ALL the sensors right now, no other Op-Code available... :(
+Has not been thoroughly tested but seems to work as expected
 
 \end{itemize}
 
@@ -1202,24 +1269,24 @@ This clears ALL the sensors right now, no other Op-Code available... :(
 \index{setProperties() (source.Sensor method)}
 
 \begin{fulllineitems}
-\phantomsection\label{source:source.Sensor.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{sensor}, \emph{varargin}}{}
+\phantomsection\label{Sensor:source.Sensor.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{sensor}, \emph{varargin}}{}
 Sets multiple Sensor properties at once using MATLAB's inputParser.
 \begin{quote}\begin{description}
 \item[{Parameters}] \leavevmode\begin{itemize}
 \item {} 
-\textbf{\texttt{debug}} (\emph{\texttt{bool}}) -- 
+\textbf{\texttt{debug}} (\emph{\texttt{bool}}) -- \emph{{[}OPTIONAL{]}}
 
 \item {} 
-\textbf{\texttt{mode}} (\emph{\texttt{DeviceMode.\{Type\}}}) -- 
+\textbf{\texttt{mode}} (\emph{\texttt{DeviceMode.\{Type\}}}) -- \emph{{[}OPTIONAL{]}}
 
 \end{itemize}
 
 \end{description}\end{quote}
 \paragraph{Example}
 
-b = EV3(); 
-b.connect(`bt', `serPort', `/dev/rfcomm0'); 
-b.sensor1.setProperties(`debug', `on', `mode', DeviceMode.Color.Ambient); 
+b = EV3(); \% 
+b.connect(`bt', `serPort', `/dev/rfcomm0'); \% 
+b.sensor1.setProperties(`debug', `on', `mode', DeviceMode.Color.Ambient); \% 
 \% Instead of: b.sensor1.debug = `on'; 
 \%             b.sensor1.mode = DeviceMode.Color.Ambient; 
 
@@ -1229,26 +1296,759 @@ b.sensor1.setProperties(`debug', `on', `mode', DeviceMode.Color.Ambient);
 \end{fulllineitems}
 
 
+Low-Level documentation
+\phantomsection\label{hid:module-source}\index{source (module)}
+
+\section{hidapi}
+\label{hid:hidapi}\label{hid::doc}\index{hidapi (class in source)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{hidapi}}{\emph{vendorID}, \emph{productID}, \emph{nReadBuffer}, \emph{nWriteBuffer}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[hid:source.hidapi.open]{\sphinxcrossref{\sphinxcode{open()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.close]{\sphinxcrossref{\sphinxcode{close()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.read]{\sphinxcrossref{\sphinxcode{read()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.read_timeout]{\sphinxcrossref{\sphinxcode{read\_timeout()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.write]{\sphinxcrossref{\sphinxcode{write()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getHIDInfoString]{\sphinxcrossref{\sphinxcode{getHIDInfoString()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.setNonBlocking]{\sphinxcrossref{\sphinxcode{setNonBlocking()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.init]{\sphinxcrossref{\sphinxcode{init()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.exit]{\sphinxcrossref{\sphinxcode{exit()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.error]{\sphinxcrossref{\sphinxcode{error()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.enumerate]{\sphinxcrossref{\sphinxcode{enumerate()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getManufacturersString]{\sphinxcrossref{\sphinxcode{getManufacturersString()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getProductString]{\sphinxcrossref{\sphinxcode{getProductString()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getSerialNumberString]{\sphinxcrossref{\sphinxcode{getSerialNumberString()}}}}
+
+\end{itemize}
+
+\end{description}
+
+Interface to the hidapi library
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Developed from the hidapi available at \url{http://www.signal11.us/oss/hidapi/}.
+
+\item {} 
+Windows: hidapi.dll needed.
+
+\item {} 
+Mac: hidapi.dylib needed. In addition, Xcode has to be installed.
+
+\item {} 
+Linux: hidapi has to be compiled on host-system.
+
+\end{itemize}
+\index{handle (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.handle}\pysigline{\sphinxbfcode{handle}}
+\end{fulllineitems}
+
+\index{vendorID (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.vendorID}\pysigline{\sphinxbfcode{vendorID}}
+\emph{numeric} -- Vendor-ID of the USB device.
+
+\end{fulllineitems}
+
+\index{productID (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.productID}\pysigline{\sphinxbfcode{productID}}
+\emph{numeric} -- Product-ID of the USB device.
+
+\end{fulllineitems}
+
+\index{nReadBuffer (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.nReadBuffer}\pysigline{\sphinxbfcode{nReadBuffer}}
+\emph{numeric} -- Read-buffer size in bytes.
+
+\end{fulllineitems}
+
+\index{nWriteBuffer (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.nWriteBuffer}\pysigline{\sphinxbfcode{nWriteBuffer}}
+\emph{numeric} -- Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet.
+
+\end{fulllineitems}
+
+\index{slib (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.slib}\pysigline{\sphinxbfcode{slib}}
+\emph{string} -- Name of shared library file (without file extension). Defaults to
+`hidapi'.
+
+\end{fulllineitems}
+
+\index{sheader (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.sheader}\pysigline{\sphinxbfcode{sheader}}
+\emph{string} -- Name of shared library header. Defaults to `hidapi.h'.
+
+\end{fulllineitems}
+
+\paragraph{Example}
+
+hidHandle = hidapi(1684,0005,1024,1025); \%\textbar{}br\textbar{}
+\index{close() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.close}\pysiglinewithargsret{\sphinxbfcode{close}}{\emph{hid}}{}
+Close the connection to a hid device.
+\begin{description}
+\item[{Throws:}] \leavevmode
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Gets called automatically when deleting the hidapi instance.
+
+\end{itemize}
+\begin{enumerate}
+\setcounter{enumi}{2000}
+\item {} 
+Check if pointer is (unexpectedly) already invalidated
+
+\end{enumerate}
+
+\end{fulllineitems}
+
+\index{enumerate() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.enumerate}\pysiglinewithargsret{\sphinxbfcode{enumerate}}{\emph{hid}, \emph{vendorID}, \emph{productID}}{}
+Enumerates the info about the hid device with the given vendorID and productID
+and returns a string with the returned hid information.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode\begin{itemize}
+\item {} 
+\textbf{\texttt{vendorID}} (\emph{\texttt{numeric}}) -- Vendor-ID of the USB device in decimal.
+
+\item {} 
+\textbf{\texttt{productID}} (\emph{\texttt{numeric}}) -- Product-ID of the USB device in decimal.
+
+\end{itemize}
 
-\chapter{Indices and tables}
-\label{index:indices-and-tables}\begin{itemize}
+\end{description}\end{quote}
+\paragraph{Notes}
+\begin{itemize}
 \item {} 
-\emph{genindex}
+Using a vendorID and productID of (0,0) will enumerate all connected hid
+devices.
 
 \item {} 
-\emph{modindex}
+MATLAB does not have the hid\_device\_infoPtr struct so some of the returned
+information will need to be resized and cast into uint8 or chars.
+
+\end{itemize}
+
+Enumerate the hid devices
+
+\end{fulllineitems}
+
+\index{error() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.error}\pysiglinewithargsret{\sphinxbfcode{error}}{\emph{hid}}{}
+Return the hid device error string if a function produced an error.
+\begin{description}
+\item[{Throws:}] \leavevmode
+InvalidHandle: Handle to USB-device not valid
 
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
 \item {} 
-\emph{search}
+This function must be called explicitly if you think an error was generated
+from the hid device.
 
 \end{itemize}
+\begin{enumerate}
+\setcounter{enumi}{2000}
+\item {} 
+Check if pointer is (unexpectedly) already invalidated
+
+\end{enumerate}
+
+\end{fulllineitems}
+
+\index{exit() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.exit}\pysiglinewithargsret{\sphinxbfcode{exit}}{\emph{hid}}{}
+hidapi.exit Exit hidapi
+
+hid.exit() exits the hidapi library.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+
+\end{description}
+
+Notes::
+- You should not have to call this function directly.
+
+\end{fulllineitems}
+
+\index{getHIDInfoString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getHIDInfoString}\pysiglinewithargsret{\sphinxbfcode{getHIDInfoString}}{\emph{hid}, \emph{info}}{}
+Get the corresponding hid info from the hid device.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Info is the hid information string.
+
+\end{itemize}
+
+See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+HIDAPI.GETSERIALNUMBERSTRING.
+
+Read buffer nReadBuffer length
+
+\end{fulllineitems}
+
+\index{getManufacturersString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getManufacturersString}\pysiglinewithargsret{\sphinxbfcode{getManufacturersString}}{\emph{hid}}{}
+Get manufacturers string from hid object using getHIDInfoString.
+
+\end{fulllineitems}
+
+\index{getProductString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getProductString}\pysiglinewithargsret{\sphinxbfcode{getProductString}}{\emph{hid}}{}
+Get product string from hid object using getProductString.
+
+\end{fulllineitems}
+
+\index{getSerialNumberString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getSerialNumberString}\pysiglinewithargsret{\sphinxbfcode{getSerialNumberString}}{\emph{hid}}{}
+Get serial number from hid object using getSerialNumberString.
+
+\end{fulllineitems}
+
+\index{init() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.init}\pysiglinewithargsret{\sphinxbfcode{init}}{\emph{hid}}{}
+Inits the hidapi library.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+This is called automatically in the library itself with the open function. You
+should not have to call this function directly.
+
+\end{itemize}
+
+\end{fulllineitems}
+
+\index{open() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.open}\pysiglinewithargsret{\sphinxbfcode{open}}{\emph{hid}}{}
+Open a connection with a hid device
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Gets called automatically when creating an hidapi-object.
+
+\item {} 
+The pointer return value from this library call is always null so it is not
+possible to know if the open was successful.
+
+\item {} 
+The final parameter to the open hidapi library call has different types
+depending on OS. On windows it is uint16, on linux/mac int32.
+
+\end{itemize}
+
+Create a null pointer for the hid\_open function (depends on OS)
+
+\end{fulllineitems}
+
+\index{read() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.read}\pysiglinewithargsret{\sphinxbfcode{read}}{\emph{hid}}{}
+Read from a hid device and returns the read bytes.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Will print an error if no data was read.
+
+\end{itemize}
+
+Read buffer of nReadBuffer length
+
+\end{fulllineitems}
+
+\index{read\_timeout() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.read_timeout}\pysiglinewithargsret{\sphinxbfcode{read\_timeout}}{\emph{hid}, \emph{timeOut}}{}
+Read from a hid device with a timeout and return the read bytes.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{timeOut}} (\emph{\texttt{numeric \textgreater{}= 0}}) -- Milliseconds after which a timeout-error occurs if no
+packet could be read.
+
+\end{description}\end{quote}
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+
+Read buffer of nReadBuffer length
+
+\end{fulllineitems}
+
+\index{setNonBlocking() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.setNonBlocking}\pysiglinewithargsret{\sphinxbfcode{setNonBlocking}}{\emph{hid}, \emph{nonblock}}{}
+Set the non blocking flag on the hid device connection.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{nonblock}} (\emph{\texttt{numeric in \{0,1\}}}) -- 0 disables nonblocking, 1 enables nonblocking
+
+\end{description}\end{quote}
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\begin{enumerate}
+\setcounter{enumi}{2000}
+\item {} 
+Check if pointer is (unexpectedly) already invalidated
+
+\end{enumerate}
+
+\end{fulllineitems}
+
+\index{write() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.write}\pysiglinewithargsret{\sphinxbfcode{write}}{\emph{hid}, \emph{wmsg}, \emph{reportID}}{}
+Write to a hid device.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Will print an error if there is a mismatch between the buffer size and the
+reported number of bytes written.
+
+\end{itemize}
+
+Append a 0 at the front for HID report ID
+
+\end{fulllineitems}
+
+
+\end{fulllineitems}
+
+\phantomsection\label{usbBrickIO:module-source}\index{source (module)}
+
+\section{usbBrickIO}
+\label{usbBrickIO:usbbrickio}\label{usbBrickIO::doc}\index{usbBrickIO (class in source)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{usbBrickIO}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.open]{\sphinxcrossref{\sphinxcode{open()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.close]{\sphinxcrossref{\sphinxcode{close()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.read]{\sphinxcrossref{\sphinxcode{read()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.write]{\sphinxcrossref{\sphinxcode{write()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
+USB interface between MATLAB and the brick
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Uses the hid library implementation in hidapi.m
+
+\item {} 
+The default parameters should always work when you try to connect to an EV3 brick,
+so in nearly all use-cases, the constructor does not need any parameters (besides
+`debug' eventually).
+
+\end{itemize}
+\index{debug (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.debug}\pysigline{\sphinxbfcode{debug}}
+\emph{bool} -- If true, each open/close/read/write-call will be noted in the console.
+Defaults to false.
+
+\end{fulllineitems}
+
+\index{vendorID (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.vendorID}\pysigline{\sphinxbfcode{vendorID}}
+\emph{numeric} -- Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).
+
+\end{fulllineitems}
+
+\index{productID (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.productID}\pysigline{\sphinxbfcode{productID}}
+\emph{numeric} -- Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).
+
+\end{fulllineitems}
+
+\index{nReadBuffer (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.nReadBuffer}\pysigline{\sphinxbfcode{nReadBuffer}}
+\emph{numeric} -- Read-buffer size in bytes. Defaults to 1024.
+
+\end{fulllineitems}
+
+\index{nWriteBuffer (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.nWriteBuffer}\pysigline{\sphinxbfcode{nWriteBuffer}}
+\emph{numeric} -- Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet. Defaults to 1025 (EV3 USB maximum packet size = 1024).
+
+\end{fulllineitems}
+
+\index{timeOut (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.timeOut}\pysigline{\sphinxbfcode{timeOut}}
+\emph{numeric \textgreater{}= 0} -- Milliseconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10000.
+
+\end{fulllineitems}
+
+\paragraph{Examples}
+
+\% Connecting via USB 
+commHandle = usbBrickIO(); \% 
+\% Connecting via USB with enabled debug output 
+commHandle = usbBrickIO(`debug', true); \% 
+\index{close() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.close}\pysiglinewithargsret{\sphinxbfcode{close}}{\emph{brickIO}}{}
+Closes the usb connection the brick through the hidapi interface.
+
+\end{fulllineitems}
+
+\index{open() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.open}\pysiglinewithargsret{\sphinxbfcode{open}}{\emph{brickIO}}{}
+Opens the usb connection to the brick through the hidapi interface.
+
+\end{fulllineitems}
+
+\index{read() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.read}\pysiglinewithargsret{\sphinxbfcode{read}}{\emph{brickIO}}{}
+Reads data from the brick through usb using the hidapi interface and returns the data in uint8 format.
+
+\end{fulllineitems}
+
+\index{setProperties() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{brickIO}, \emph{varargin}}{}
+Sets multiple usbBrickIO properties at once using MATLAB's inputParser.
+
+The syntax is as follows: commHandle.setProperties(`propertyName1',
+propertyValue1, `propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, vendorID, productID, nReadBuffer, nWriteBuffer, timeOut.
+
+See also USBBRICKIO.DEBUG, USBBRICKIO.VENDORID, USBBRICKIO.PRODUCTID,
+USBBRICKIO.NREADBUFFER, USBBRICKIO.NWRITEBUFFER, USBBRICKIO.TIMEOUT
+
+\end{fulllineitems}
+
+\index{write() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.write}\pysiglinewithargsret{\sphinxbfcode{write}}{\emph{brickIO}, \emph{wmsg}}{}
+Writes data to the brick through usb using the hidapi interface.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{wmsg}} (\emph{\texttt{uint8 array}}) -- Data to be written to the brick via usb
+
+\end{description}\end{quote}
+
+\end{fulllineitems}
+
+
+\end{fulllineitems}
+
+\phantomsection\label{btBrickIO:module-source}\index{source (module)}
+
+\section{btBrickIO}
+\label{btBrickIO:btbrickio}\label{btBrickIO::doc}\index{btBrickIO (class in source)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{btBrickIO}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.open]{\sphinxcrossref{\sphinxcode{open()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.close]{\sphinxcrossref{\sphinxcode{close()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.read]{\sphinxcrossref{\sphinxcode{read()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.write]{\sphinxcrossref{\sphinxcode{write()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
+Bluetooth interface between MATLAB and the brick
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Connects to the bluetooth module on the host through a serial
+connection. Hence be sure that a serial connection to the bluetooth
+module can be made. Also be sure that the bluetooth module has been paired
+to the brick before trying to connect.
+
+\item {} \begin{description}
+\item[{Usage is OS-dependent:}] \leavevmode\begin{itemize}
+\item {} 
+Windows: the deviceName- \& channel-properties are needed for connection. The implementation is based on the Instrument Control toolbox.
+
+\item {} 
+Linux (and potentially Mac): serialPort-property is needed for connection. The implementation is based on MATLAB's serial port implementation.
+
+\end{itemize}
+
+\end{description}
+
+\item {} 
+For general information, see also \sphinxcode{BrickIO}.
+
+\end{itemize}
+\index{debug (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.debug}\pysigline{\sphinxbfcode{debug}}
+\emph{bool} -- If true, each open/close/read/write-call will be shown in the console.
+Defaults to false.
+
+\end{fulllineitems}
+
+\index{serialPort (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.serialPort}\pysigline{\sphinxbfcode{serialPort}}
+\emph{string} -- Path to the serial-port object. Only needed when using MATLAB's
+serial class (i.e. on linux/mac). Defaults to `/dev/rfcomm0'.
+
+\end{fulllineitems}
+
+\index{deviceName (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.deviceName}\pysigline{\sphinxbfcode{deviceName}}
+\emph{string} -- Name of the BT-device = the brick. Only needed when using the
+Instrument Control toolbox (i.e. on windows). Defaults to `EV3'.
+
+\end{fulllineitems}
+
+\index{channel (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.channel}\pysigline{\sphinxbfcode{channel}}
+\emph{numeric \textgreater{} 0} -- BT-channel of the connected BT-device. Only needed when using
+the Instrument Control toolbox (i.e. on windows). Defaults to 1.
+
+\end{fulllineitems}
+
+\index{timeOut (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.timeOut}\pysigline{\sphinxbfcode{timeOut}}
+\emph{numeric \textgreater{}= 0} -- seconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10.
+
+\end{fulllineitems}
+
+\index{backend (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.backend}\pysigline{\sphinxbfcode{backend}}
+\emph{`serial'\textbar{}'instrumentControl'} -- Backend this implementation is based on. Is
+automatically chosen depending on the OS. Defaults to `serial' on linux/mac
+systems, and to `instrumentControl' on windows systems.
+
+\end{fulllineitems}
+
+\paragraph{Examples}
+
+\% Connecting on windows 
+commHandle = btBrickIO(`deviceName', `MyEV3', `channel', 1); \% 
+\% Connecting on windows using MATLABs default serial port implementation for testing 
+commHandle = btBrickIO(`deviceName', `MyEV3', `channel', 1, `backend', `serial'); \% 
+\% Connecting on mac/linux 
+commHandle = btBrickIO(`serPort', `/dev/rfcomm0'); \% 
+\index{close() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.close}\pysiglinewithargsret{\sphinxbfcode{close}}{\emph{brickIO}}{}
+Closes the bluetooth connection the brick using fclose.
+
+\end{fulllineitems}
+
+\index{open() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.open}\pysiglinewithargsret{\sphinxbfcode{open}}{\emph{brickIO}}{}
+Opens the bluetooth connection to the brick using fopen.
+
+\end{fulllineitems}
+
+\index{read() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.read}\pysiglinewithargsret{\sphinxbfcode{read}}{\emph{brickIO}}{}
+Reads data from the brick through bluetooth via fread and returns the data in uint8 format.
+
+\end{fulllineitems}
+
+\index{setProperties() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{brickIO}, \emph{varargin}}{}
+Sets multiple btBrickIO properties at once using MATLAB's inputParser.
+
+The syntax is as follows: commHandle.setProperties(`propertyName1',
+propertyValue1, `propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, serPort, deviceName, channel, timeout.
+
+See also BTBRICKIO.DEBUG, BTBRICKIO.SERIALPORT, BTBRICKIO.DEVICENAME,
+BTBRICKIO.CHANNEL, BTBRICKIO.TIMEOUT
+
+\end{fulllineitems}
+
+\index{write() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.write}\pysiglinewithargsret{\sphinxbfcode{write}}{\emph{brickIO}, \emph{wmsg}}{}
+Writes data to the brick through bluetooth via fwrite.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{wmsg}} (\emph{\texttt{uint8 array}}) -- Data to be written to the brick via bluetooth
+
+\end{description}\end{quote}
+
+\end{fulllineitems}
+
+
+\end{fulllineitems}
+
 
 
 \renewcommand{\indexname}{MATLAB Module Index}
 \begin{theindex}
 \def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
 \bigletter{s}
-\item {\texttt{source}}, \pageref{source:module-source}
+\item {\texttt{source}}, \pageref{usbBrickIO:module-source}
 \end{theindex}
 
 \renewcommand{\indexname}{Index}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.toc b/docs/_build/latex/MindstormsEV3Toolbox.toc
index 0a57b6171e5eb7a4250ee68435aaae78681d6579..78021444cdb9307a52fb1e68f90805238a95dad6 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.toc
+++ b/docs/_build/latex/MindstormsEV3Toolbox.toc
@@ -1,27 +1,46 @@
 \select@language {english}
-\contentsline {chapter}{\numberline {1}EV3}{3}{chapter.1}
+\contentsline {chapter}{\numberline {1}Contents}{3}{chapter.1}
+\contentsline {section}{\numberline {1.1}EV3}{3}{section.1.1}
 \contentsline {paragraph}{Notes}{3}{paragraph*.5}
-\contentsline {paragraph}{Examples}{4}{paragraph*.18}
+\contentsline {paragraph}{Example}{4}{paragraph*.18}
 \contentsline {paragraph}{Notes}{4}{paragraph*.20}
 \contentsline {paragraph}{Example}{4}{paragraph*.21}
-\contentsline {paragraph}{Examples}{4}{paragraph*.23}
-\contentsline {paragraph}{Notes}{4}{paragraph*.25}
+\contentsline {paragraph}{Example}{5}{paragraph*.23}
+\contentsline {paragraph}{Notes}{5}{paragraph*.25}
 \contentsline {paragraph}{Example}{5}{paragraph*.26}
 \contentsline {paragraph}{Example}{5}{paragraph*.28}
-\contentsline {paragraph}{Example}{5}{paragraph*.30}
-\contentsline {paragraph}{Example}{5}{paragraph*.33}
-\contentsline {chapter}{\numberline {2}Motor}{7}{chapter.2}
+\contentsline {paragraph}{Example}{6}{paragraph*.30}
+\contentsline {paragraph}{Example}{6}{paragraph*.32}
+\contentsline {section}{\numberline {1.2}Motor}{6}{section.1.2}
 \contentsline {paragraph}{Notes}{7}{paragraph*.36}
 \contentsline {paragraph}{Notes}{8}{paragraph*.50}
-\contentsline {paragraph}{Example}{9}{paragraph*.54}
-\contentsline {paragraph}{Notes}{9}{paragraph*.56}
-\contentsline {paragraph}{Notes}{10}{paragraph*.59}
-\contentsline {paragraph}{Example}{10}{paragraph*.60}
+\contentsline {paragraph}{Notes}{8}{paragraph*.53}
+\contentsline {paragraph}{Example}{9}{paragraph*.55}
+\contentsline {paragraph}{Notes}{9}{paragraph*.58}
+\contentsline {paragraph}{Notes}{9}{paragraph*.60}
+\contentsline {paragraph}{Example}{9}{paragraph*.61}
 \contentsline {paragraph}{Notes}{10}{paragraph*.63}
-\contentsline {chapter}{\numberline {3}Sensor}{11}{chapter.3}
-\contentsline {paragraph}{Notes}{11}{paragraph*.65}
-\contentsline {paragraph}{Notes}{13}{paragraph*.71}
-\contentsline {paragraph}{Example}{14}{paragraph*.73}
-\contentsline {chapter}{\numberline {4}Indices and tables}{15}{chapter.4}
-\contentsline {chapter}{MATLAB Module Index}{17}{section*.74}
-\contentsline {chapter}{Index}{19}{section*.75}
+\contentsline {paragraph}{Notes}{10}{paragraph*.65}
+\contentsline {section}{\numberline {1.3}Sensor}{10}{section.1.3}
+\contentsline {paragraph}{Notes}{10}{paragraph*.68}
+\contentsline {paragraph}{Notes}{13}{paragraph*.74}
+\contentsline {paragraph}{Example}{13}{paragraph*.76}
+\contentsline {section}{\numberline {1.4}hidapi}{13}{section.1.4}
+\contentsline {paragraph}{Notes}{14}{paragraph*.79}
+\contentsline {paragraph}{Example}{14}{paragraph*.87}
+\contentsline {paragraph}{Notes}{15}{paragraph*.89}
+\contentsline {paragraph}{Notes}{15}{paragraph*.91}
+\contentsline {paragraph}{Notes}{15}{paragraph*.93}
+\contentsline {paragraph}{Notes}{15}{paragraph*.96}
+\contentsline {paragraph}{Notes}{16}{paragraph*.101}
+\contentsline {paragraph}{Notes}{16}{paragraph*.103}
+\contentsline {paragraph}{Notes}{16}{paragraph*.105}
+\contentsline {paragraph}{Notes}{17}{paragraph*.109}
+\contentsline {section}{\numberline {1.5}usbBrickIO}{17}{section.1.5}
+\contentsline {paragraph}{Notes}{17}{paragraph*.112}
+\contentsline {paragraph}{Examples}{18}{paragraph*.119}
+\contentsline {section}{\numberline {1.6}btBrickIO}{18}{section.1.6}
+\contentsline {paragraph}{Notes}{19}{paragraph*.127}
+\contentsline {paragraph}{Examples}{19}{paragraph*.134}
+\contentsline {chapter}{MATLAB Module Index}{21}{section*.140}
+\contentsline {chapter}{Index}{23}{section*.141}
diff --git a/docs/btBrickIO.rst b/docs/btBrickIO.rst
new file mode 100644
index 0000000000000000000000000000000000000000..5e076d50dc1c141aef7ed955e216f4b3a438723c
--- /dev/null
+++ b/docs/btBrickIO.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+btBrickIO
+=========
+
+.. autoclass:: btBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/docs/conf.py b/docs/conf.py
index e09d3c575df98cad20545f3d4eeb5588104a5221..f0141b9e502441b4cb9f5bb6a9c72486487de689 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -81,17 +81,17 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'Mindstorms EV3 Toolbox'
-copyright = u'2016, LfB - RWTH Aachen'
-author = u'LfB - RWTH Aachen'
+copyright = u'2017, RWTH Aachen'
+author = u'RWTH Aachen'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = u'v0.4'
+version = u'v1.0'
 # The full version, including alpha/beta/rc tags.
-release = u'v0.4-rc.10'
+release = u'v1.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -157,7 +157,8 @@ html_theme = 'bootstrap'
 # further.  For a list of options available for each theme, see the
 # documentation.
 #
-# html_theme_options = {}
+html_theme_options = {'navbar_fixed_top': True,
+			'bootswatch_theme': "readable"}
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []
diff --git a/docs/examples.rst b/docs/examples.rst
new file mode 100644
index 0000000000000000000000000000000000000000..7023309f75ff7a2f34e0d931f293f138eab99c60
--- /dev/null
+++ b/docs/examples.rst
@@ -0,0 +1,17 @@
+========
+Examples
+========
+
+.. code-block:: matlab
+
+	% This example expects a motor at port A and a (random) sensor at port 1 
+	b = EV3(); 
+	b.connect('usb'); 
+	ma = b.motorA; 
+	ma.setProperties('power', 50, 'limitValue', 720); 
+	ma.start(); 
+	% fun
+	ma.waitFor(); 
+	disp(b.sensor1.value); 
+	b.beep(); 
+	b.delete(); 
diff --git a/docs/hid.rst b/docs/hid.rst
new file mode 100644
index 0000000000000000000000000000000000000000..a81e179691da5a39122479c305bd02a5f82a5619
--- /dev/null
+++ b/docs/hid.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+hidapi
+======
+
+.. autoclass:: hidapi
+   :members: open, close, read, read_timeout, write, getHIDInfoString, setNonBlocking, init, exit, error, enumerate, getManufacturersString, getProductString, getSerialNumberString
diff --git a/docs/index.rst b/docs/index.rst
index 32339b8c15a093a9abd83ae2f95e974280f64bda..9ee56c01ac71e7761e2ef9b53c971f77a9372926 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -3,21 +3,33 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Toolbox for controlling Lego Mindstorms EV3 with MATLAB
-=======================================================
+==================================================
+MATLAB Toolbox for controlling Lego Mindstorms EV3
+==================================================
 
-Contents:
+Hi there! This is the documentation for the "Lego Mindstorms EV3" MATLAB Toolbox,
+developed by RWTH Aachen. For an introduction about this toolbox, installation
+guides and examples, take a look at `our repository`_.
 
-.. toctree::
-   :maxdepth: 4
+.. _our repository: https://git.rwth-aachen.de/mindstorms/ev3-toolbox-matlab/blob/master/readme.md
+
+Contents
+========
 
-   source
+High-Level documentation
 
+.. toctree::
+   :maxdepth: 2
 
-Indices and tables
-==================
+   EV3
+   Motor
+   Sensor
 
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+Low-Level documentation
+
+.. toctree::
+   :maxdepth: 3
 
+   hid
+   usbBrickIO
+   btBrickIO
diff --git a/docs/initialBytecodes.odt b/docs/initialBytecodes.odt
new file mode 100644
index 0000000000000000000000000000000000000000..1654003debefd1f54e7e639a33ffc898ac1b83d7
Binary files /dev/null and b/docs/initialBytecodes.odt differ
diff --git a/docs/process.py b/docs/process.py
index a669d643c85783eb513765fc185bdb054dc2ccc9..7740639b69a3087d4493374b2d5c954f6637c518 100644
--- a/docs/process.py
+++ b/docs/process.py
@@ -5,64 +5,144 @@ from os import close, remove
 from tempfile import mkstemp
 from shutil import move
 
+TMP_FILE_STR = '%TEMP-FILE FOR BUILDING DOCUMENTATION'
+DOCUMENTED_CLASSES = ['Motor', 'Sensor', 'EV3', 'usbBrickIO', 'btBrickIO']  # If a new class shall be documented, it needs to be added to this list
+
 def preprocess():
     """Preprocesses data for building documentation
 
-    The MATLAB Sphinx extension takes veeery (or even infinitely?) long
-    to build the documentation if a class contains an enumeration.
+    Fixes the following problems:
+        - Comment out enumerations (The MATLAB Sphinx
+        extension takes veeery (or even infinitely?) long to build the
+        documentation if a class contains an enumeration)
+        - Insert comments for creating a list of methods a class contains (Names of
+        relevant methods taken from corresponding .rst-file. This is necessary
+        as the MATLAB Sphinx Extension has no functionality for creating compact
+        method lists.:( )
+
+        -> After creating the documentation, the changes are unmade (postprocess())
+
+    Prerequisites:
+        - Has to be inside toolboxFile/docs
+        - comments in the MATLAB source files shouldn't include the keywords
+        'classdef' and 'enumeration'
     """
 
     code_dir = os.path.abspath('../source')
-    files = _matlab_files(os.listdir(code_dir))
-    
+    files = _matlab_files(os.listdir(code_dir))  # Get list of all toolbox source files
+
+    documented_methods = _find_documented_methods()  # Get names of all documented methods from .rst-files
+
     n_files = len(files)
     for n, file_name in enumerate(files):
-        # print("Preprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files))
         try:
             fh, abs_path = mkstemp()
             with open(code_dir + "/" + file_name, 'r') as f:
-                with open(abs_path, 'w') as ftemp: 
+                with open(abs_path, 'w') as ftemp:
                     content = f.readlines()
-                    if content[0] == '%TEMP-FILE FOR BUILDING DOCUMENTATION\n':
-                        raise RuntimeError('Found already preprocessed file.')
+                    if content[0] == TMP_FILE_STR + '\n':
+                        raise RuntimeError('Found already preprocessed file: ' + file_name)
 
                     try:
-                        for i, line in enumerate(content):  # Worst runtime ever 
-                            if _ignore_line(line) is False and 'enumeration' in line:
-                                ftemp.write('%TEMP-FILE FOR BUILDING DOCUMENTATION\n')
-                                _write_lines(content[:i], ftemp)
-                                for j, enum_line in enumerate(content[i:]):
-                                   ftemp.write(" %"+enum_line)
-                                   if " end" in enum_line or "end\n" == enum_line:		
-                                        _write_lines(content[i+1+j:], ftemp)
-                                        close(fh)
-                                        remove(code_dir + "/" + file_name)
-                                        move(abs_path, code_dir + "/" + file_name)
-                                        # At this point, entire file has been processed: continue outer loop
-                                        # Hackily implemented by raising an exception
-                                        raise StopIteration  
-                    except StopIteration:
-                        continue
+                        for i, line in enumerate(content):  # Worst runtime ever: Iterate over entire file line by line
+                            if _ignore_line(line) is False:
+                                if 'classdef' in line:  # Insert method-list string in relevant class docs
+                                    class_name = line.replace(' ', '').split('%')[0].split('<')[0].split('classdef')[1]
+                                    try:
+                                        methods = documented_methods[class_name]
+
+                                        line = line.replace('\n', '') + '  ' + TMP_FILE_STR + '\n'
+
+                                        _write_lines(content[:i], ftemp)
+                                        _write_lines([line], ftemp)
+                                        _write_lines(_method_lines(methods), ftemp)
+                                        _write_lines(content[i+1:], ftemp)
+
+                                    except KeyError:
+                                        ignore_class = True
+                                        continue
+
+                                    close(fh)
+                                    remove(code_dir + "/" + file_name)
+                                    move(abs_path, code_dir + "/" + file_name)
+
+                                    raise StopIteration
+                                elif 'enumeration' in line:  # Comment out enumeration
+                                    ftemp.write(TMP_FILE_STR + '\n')
+                                    _write_lines(content[:i], ftemp)
+                                    for j, enum_line in enumerate(content[i:]):
+                                        ftemp.write(" %"+enum_line)
+                                        if " end" in enum_line or "end\n" == enum_line:
+                                            _write_lines(content[i+1+j:], ftemp)
+                                            close(fh)
+                                            remove(code_dir + "/" + file_name)
+                                            move(abs_path, code_dir + "/" + file_name)
+
+                                            raise StopIteration
+                    except StopIteration:  # This exception is like a 'continue' for the outer loop when inside an inner loop
+                        pass
         except IOError:
             pass
 
+        if file_name == 'EV3.m':
+            fh, abs_path = mkstemp()
+            with open(code_dir + "/" + file_name, 'r') as f:
+                with open(abs_path, 'w') as ftemp:
+                    content = f.readlines()
+                    for i, line in enumerate(content):
+                        if 'methods (Access = {?' in line:
+                            line = line.replace('methods (Access = {?', 'methods %(Access = {?')
+
+                            _write_lines(content[:i], ftemp)
+                            _write_lines([line], ftemp)
+                            _write_lines(content[i+1:], ftemp)
+
+                            close(fh)
+                            remove(code_dir + "/" + file_name)
+                            move(abs_path, code_dir + "/" + file_name)
+
+                            break
+
 def postprocess():
+    """Postprocesses data after building documentation
+
+    This function reverses the changes done by preprocess() and calls
+    postprocess_html_files afterwards.
+    """
     code_dir = os.path.abspath('../source')
     files = _matlab_files(os.listdir(code_dir))
-    
+
+    documented_methods = _find_documented_methods()
+
     n_files = len(files)
     for n, file_name in enumerate(files):
-        # print("Postprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files))
         try:
             fh, abs_path = mkstemp()
             with open(code_dir + "/" + file_name, 'r') as f:
-                with open(abs_path, 'w') as ftemp: 
+                with open(abs_path, 'w') as ftemp:
                     content = f.readlines()
-                    if content[0] != '%TEMP-FILE FOR BUILDING DOCUMENTATION\n':
-                        continue
                     try:
                         for i, line in enumerate(content):  # Worst runtime ever
-                            if 'enumeration' in line:
+                            if 'classdef' in line and '%TEMP-FILE FOR BUILDING DOCUMENTATION' in line:
+                                class_name = line.replace(' ', '').split('%')[0].split('<')[0].split('classdef')[1]
+                                try:
+                                    n_methods = len(documented_methods[class_name])
+
+                                    line = line.replace('  '+TMP_FILE_STR, '')
+
+                                    _write_lines(content[:i], ftemp)
+                                    _write_lines([line], ftemp)
+                                    _write_lines(content[i+n_methods+5:], ftemp)
+
+                                except KeyError:
+                                    continue
+
+                                close(fh)
+                                remove(code_dir + "/" + file_name)
+                                move(abs_path, code_dir + "/" + file_name)
+
+                                raise StopIteration
+                            elif 'enumeration' in line:
                                 _write_lines(content[1:i], ftemp)
                                 for j, enum_line in enumerate(content[i:]):
                                    ftemp.write(enum_line.replace(' %', '', 1))
@@ -71,14 +151,80 @@ def postprocess():
                                         close(fh)
                                         remove(code_dir + "/" + file_name)
                                         move(abs_path, code_dir + "/" + file_name)
-                                        # At this point, entire file has been processed: continue outer loop
-                                        # Hackily implemented by raising an exception
-                                        raise StopIteration 
+
+                                        raise StopIteration  # At this point, entire file has been processed: continue outer loop
                     except StopIteration:
-                        continue
+                        pass
         except IOError:
             pass
-         
+
+        if file_name == 'EV3.m':
+            fh, abs_path = mkstemp()
+            with open(code_dir + "/" + file_name, 'r') as f:
+                with open(abs_path, 'w') as ftemp:
+                    content = f.readlines()
+                    for i, line in enumerate(content):
+                        if 'methods %(Access = {?' in line:
+                            line = line.replace('methods %(Access = {?', 'methods (Access = {?')
+
+                            _write_lines(content[:i], ftemp)
+                            _write_lines([line], ftemp)
+                            _write_lines(content[i+1:], ftemp)
+
+                            close(fh)
+                            remove(code_dir + "/" + file_name)
+                            move(abs_path, code_dir + "/" + file_name)
+
+                            break
+
+    postprocess_html_files()
+
+def postprocess_html_files():
+    """ Postprocesses the created doc html-files
+
+    Some formatting and internal errors occurs when the HTML-files are created.
+    The following bugs have been found and are being fixed by this function:
+        - Replace ` with ' (This is necessary to make code examples
+        copy-pastable. During the creation of the html-files ' has been replaced
+        by ` for some reason.)
+        - Delete module name from class documentation (Sphinx wrongly interprets
+        the file-name of the toolbox as the module name, which it would be if it
+        were dealing with Python)
+        - Replace wrong hrefs by internal links (Some would-be-internal links
+        wrongly point to some ominous 'source.html'-file)
+    """
+
+    for file_name in DOCUMENTED_CLASSES:
+        current_file = os.path.abspath('_build/html/' + file_name + '.html')
+        try:
+            fh, abs_path = mkstemp()
+            with open(current_file, 'r') as f_old:
+                with open(abs_path, 'w') as f_new:
+                    content = f_old.readlines()
+                    for i, line in enumerate(content):
+                        # Replace ` with '
+                        if('&#8216' in line or '&#8217' in line):
+                            line = line.replace('&#8216;', '\'').replace('&#8217;', '\'')
+
+                        # Delete module name from class documentation
+                        ugly_module_string = '<code class="descclassname">source.</code>'
+                        if(ugly_module_string in line):
+                            line = line.replace(ugly_module_string, '')
+
+                        # Replace wrong hrefs by internal links
+                        wrong_href = 'source.html'
+                        if(wrong_href in line):
+                            line = line.replace(wrong_href, '')
+
+                        f_new.write(line)
+                    close(fh)
+                    remove(current_file)
+                    move(abs_path, current_file)
+        except IOError:
+            print('WARNING: Couldn''t postprocess html-file ' + current_file)
+            continue
+
+## Helper functions
 def _ignore_line(line) -> bool:
     return (line.startswith('%') or line == '\n' or line == '')
 
@@ -87,4 +233,39 @@ def _write_lines(lines, f):
         f.write(line)
 
 def _matlab_files(files) -> list:
-    return [f for f in files if (f.endswith(".m") and "_" not in f and "proto" not in f)]	
+    return [f for f in files if (f.endswith(".m") and "_" not in f and "proto" not in f)]
+
+def _rst_files(files) -> list:
+    return [f for f in files if f.endswith(".rst")]
+
+def _method_lines(methods) -> list:
+    doc_lines = ['    %\n']
+    doc_lines.append('    % *List of methods*:\n')
+    for method in methods:
+        doc_lines.append('    %             * :meth:`' + method + '`\n')
+    doc_lines.append('    %\n')
+    doc_lines.append('    %\n')
+
+    return doc_lines
+
+def _find_documented_methods():
+    files = _rst_files(os.listdir(os.path.abspath('.')))
+
+    doc_methods = {}
+    for file_name in files:
+        with open(file_name) as f:
+            content = f.readlines()
+            class_name = ''
+
+            for i, line in enumerate(content):
+                class_string = '.. autoclass:: '
+                if class_name != '':
+                    if ':members:' in line:  # Found line with method names
+                        method_names = line.split(':members: ')[1].split(', ')
+                        method_names = [m.replace('\n', '') for m in method_names[:]]
+                        doc_methods[class_name] = method_names
+
+                if class_string in line:
+                    class_name = line.split(class_string)[1].replace('\n', '')
+
+    return doc_methods
diff --git a/docs/readme.rst b/docs/readme.rst
new file mode 100644
index 0000000000000000000000000000000000000000..ddcfba5efbf31886070e6c0c8f8f87190c277a21
--- /dev/null
+++ b/docs/readme.rst
@@ -0,0 +1,12 @@
+=======
+General
+=======
+
+Installation
+============
+
+Contribution
+============
+
+Licenses
+========
diff --git a/docs/relevanteBytecodes.odt b/docs/relevanteBytecodes.odt
new file mode 100644
index 0000000000000000000000000000000000000000..9bc75cc235238b207de3823692696bca2b55d799
Binary files /dev/null and b/docs/relevanteBytecodes.odt differ
diff --git a/docs/source.rst b/docs/source.rst
index 589e1dd71f965275426b905e185bec519a40f781..bb679dc88652edb9e25f3339b2407d052e4307f5 100644
--- a/docs/source.rst
+++ b/docs/source.rst
@@ -10,16 +10,3 @@ EV3
    :members: connect, disconnect, stopAllMotors, beep, playTone, stopTone, tonePlayed, setProperties
 
 
-Motor
-=====
-
-.. autoclass:: Motor
-   :members: start, stop, syncedStart, syncedStop, waitFor, internalReset, resetTachoCount, setBrake, setProperties
-
-
-Sensor
-======
-
-.. autoclass:: Sensor
-   :members: reset, setProperties
-
diff --git a/typedata.ods b/docs/typedata.ods
similarity index 100%
rename from typedata.ods
rename to docs/typedata.ods
diff --git a/docs/usbBrickIO.rst b/docs/usbBrickIO.rst
new file mode 100644
index 0000000000000000000000000000000000000000..785bdc9777327560b7982902df1a9df17ffb2cc9
--- /dev/null
+++ b/docs/usbBrickIO.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+usbBrickIO
+==========
+
+.. autoclass:: usbBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/initialBytecodes.odt b/initialBytecodes.odt
deleted file mode 100644
index ff55540b55caf7cf2ed4500e609c40a4cd16c19f..0000000000000000000000000000000000000000
Binary files a/initialBytecodes.odt and /dev/null differ
diff --git a/relevanteBytecodes.odt b/relevanteBytecodes.odt
deleted file mode 100644
index b2af85419ac97c13e11dbb376ea1e7b9f0aa8b70..0000000000000000000000000000000000000000
Binary files a/relevanteBytecodes.odt and /dev/null differ
diff --git a/source/BrickIO.m b/source/BrickIO.m
index 585eb6d9f54c32615c5331124bad6c1109142956..9b86316daaa464f2fc88338b02847c726145ecad 100755
--- a/source/BrickIO.m
+++ b/source/BrickIO.m
@@ -1,30 +1,36 @@
-%BrickIO Abstract class definition for brick input output
-%
-% Methods::
-%  open         Open the connection to the brick
-%  close        Close the connection to the brick
-%  read         Read data from the brick
-%  write        Write data to the brick
-%
-% Notes::
-% - handle is the connection object
-% - The read function should return a uint8 datatype
-% - The write function should be given a uint8 datatype as a parameter
-
-classdef BrickIO < handle
-    properties (Abstract, Access = 'protected')
-        % connection handle
+classdef BrickIO < MaskedHandle
+    % Abstract class definition for brick input output
+    %
+    % Notes:
+    %     * The read/write-methods use uint8-arrays.
+    %     * Instances of child-classes of BrickIO represent connection handles. The connection is
+    %       opened when creating them and closed when deleting them.
+    %
+    % Methods:
+    %     open: Open the connection to the brick
+    %     close: Close the connection to the brick
+    %     read: Read data from the brick
+    %     write: Write data to the brick
+    % 
+    
+    properties (Abstract)
+        % timeOut: time-out period (if 0, no time-out)
+        timeOut 
+    end
+    
+    properties (Abstract, Access = protected)
+        % handle: Connection handle to the device
         handle
     end
     
     methods (Abstract)
-        % open the brick connection
+        % Open the brick connection
         open(BrickIO)
-        % close the brick connection
+        % Close the brick connection
         close(BrickIO)
-        % read data from the brick
+        % Read data from the brick
         read(BrickIO)
-        % write data to the brick
+        % Write data to the brick
         write(BrickIO)
     end
 end
\ No newline at end of file
diff --git a/source/ByteCodes.m b/source/ByteCodes.m
index 455c26e7dd59cd56a7fb9dd17af006db8005248d..e35a2985fd97342a8b7fb1210f3f30bb993bd891 100644
--- a/source/ByteCodes.m
+++ b/source/ByteCodes.m
@@ -97,10 +97,10 @@ classdef ByteCodes < uint8
 %        
 
          %Communications
-         COMReady (208) % = 0xD0 @MMI
+         COMReady (208) % = 0xD0 
          COMGet (211) % = 0xD3,
          COMSet (212) % = 0xD4, 
-         COMTest (213) % = 0xD5 @MMI
+         COMTest (213) % = 0xD5 
 
 %        %Mailbox
          MailboxOpen (216) % = 0xD8,
diff --git a/source/Command.m b/source/Command.m
index bf20f962eac0182dbd579542499bc157b95b2f7e..8fb04c815b7184741cd945725b59bdafff1b2638 100755
--- a/source/Command.m
+++ b/source/Command.m
@@ -1,159 +1,157 @@
-% EV3 command construction
-%
-% Methods::
-% Command                   Constructor, creates an empty command object
-% delete                    Destructor, clears the command object
-%
-% addHeaderSystem           Adds a system header to the command object
-% addHeaderSystemReply      Adds a system header with reply to the command object
-% addHeaderDirect           Adds a direct header to the command object
-% addHeaderDirectReply      Adds a direct header with reply to the command object
-% addLength                 Adds the length of the msg to the front of the command object
-% addSystemCommand          Adds a system command to the command object
-% addDirectCommand          Adds a direct command to the command object
-%
-% checkForError @MMI        Checks error byte in received package
-% isCorrupt     @MMI        Checks whether reply packet is corrupt
-%
-% clear                     Clears the command msg
-% display                   Displays the command msg (decimal)
-% displayHex                Displays the command msg (hex)
-%
-% LC0                       Adds a local constant 0 to the command object
-% LC1                       Adds a local constant 1 to the command object
-% LC2                       Adds a local constant 2 to the command object
-% LC4                       Adds a local constant 4 to the command object
-% LV0                       Adds a local variable 0 to the command object
-% GV0                       Adds a global variable 0 to the command object
-% LCS                       Adds a local constant string to the command object
-%
-% addValue                  Adds a numerical value to the command object
-% addArray                  Adds a numerical array to the command object
-% addString                 Adds a string to the command object
-% addLCSString              Adds a LCS string to the command object
-%
-% LONGToBytes               Adds a LONGToBytes to the command object
-% WORDToBytes               Adds a WORDToBytes to the command object
-% BYTEToBytes               Adds a BYTEToBytes to the command object
-%
-% PROGRAMHeader             Adds a PROGRAMHeader to the command object
-% addFileSize               Adds the filesize to the command object
-% VMTHREADHeader            Adds a VMTHREADHeader to the command object
-% SUBCALLHeader             Adds a SUBCALLHeader to the command object
-% BLOCKHeader               Adds a BLOCKHeader to the command object
-% GenerateByteCode          Prints the command message to a file
-%
-% opNOP                     Adds a opNOP opcode to the command object
-% opOBJECT_END              Adds a opOBJECT_END opcode to the command object
-%
-% opJR                      Adds a opJR opcode to the command object
-%
-% opUI_FLUSH                Adds a opUI_FLUSH opcode to the command object
-%
-% opUI_READ_GET_VBATT       Adds a opUI_READ opcode with a GET_VBATT subcode to the command object
-% opUI_READ_GET_LBATT       Adds a opUI_READ opcode with a GET_LBATT subcode to the command object
-%
-% opUI_WRITE_PUT_STRING     Adds a opUI_WRITE opcode with a PUT_STRING subcode to the command object
-% opUI_WRITE_INIT_RUN       Adds a opUI_WRITE opcode with a INIT_RUN subcode to the command object
-% opUI_WRITE_LED            Adds a opUI_WRITE opcode with a LED subcode to the command object
-%
-% opUI_DRAW_UPDATE          Adds a opUI_DRAW opcode with a UPDATE subcode to the command object
-% opUI_DRAW_CLEAN           Adds a opUI_DRAW opcode with a CLEAN subcode to the command object
-% opUI_DRAW_PIXEL           Adds a opUI_DRAW opcode with a PIXEL subcode to the command object
-% opUI_DRAW_LINE            Adds a opUI_DRAW opcode with a LINE subcode to the command object
-% opUI_DRAW_CIRCLE          Adds a opUI_DRAW opcode with a CIRCLE subcode to the command object
-% opUI_DRAW_TEXT            Adds a opUI_DRAW opcode with a TEXT subcode to the command object
-% opUI_DRAW_VALUE           Adds a opUI_DRAW opcode with a VALUE subcode to the command object
-% opUI_DRAW_FILLRECT        Adds a opUI_DRAW opcode with a FILLRECT subcode to the command object
-% opUI_DRAW_RECT            Adds a opUI_DRAW opcode with a RECT subcode to the command object
-% opUI_DRAW_INVERSERECT     Adds a opUI_DRAW opcode with a INVERSERECT subcode to the command object
-% opUI_DRAW_SELECT_FONT     Adds a opUI_DRAW opcode with a SELECT_FONT subcode to the command object
-% opUI_DRAW_TOPLINE         Adds a opUI_DRAW opcode with a TOPLINE subcode to the command object
-% opUI_DRAW_FILLWINDOW      Adds a opUI_DRAW opcode with a FILLWINDOW subcode to the command object
-% opUI_DRAW_FILLCIRCLE      Adds a opUI_DRAW opcode with a FILLCIRCLE subcode to the command object
-% opUI_DRAW_STORE           Adds a opUI_DRAW opcode with a STORE subcode to the command object
-% opUI_DRAW_RESTORE         Adds a opUI_DRAW opcode with a RESTORE subcode to the command object
-%
-% opTIMER_WAIT              Adds a opTIMER opcode with a WAIT subcode to the command object
-% opTIMER_READY             Adds a opTIMER opcode with a READY subcode to the command object
-% opTIMER_READ              Adds a opTIMER opcode with a READ subcode to the command object
-%
-% opSOUND_BREAK             Adds a opSOUND opcode with a BREAK subcode to the command object
-% opSOUND_TONE              Adds a opSOUND opcode with a TONE subcode to the command object
-% opSOUND_PLAY              Adds a opSOUND opcode with a PLAY subcode to the command object
-% opSOUND_REPEAT            Adds a opSOUND opcode with a REPEAT subcode to the command object
-% opSOUND_TEST              Adds a opSOUND opcode with a TEST subcode to the command object
-% opSOUND_READY             Adds a opSOUND opcode with a READY subcode to the command object
-%
-% opINPUT_DEVICE_LIST                   Adds a INPUT_DEVICE opcode with a DEVICE_LIST subcode to the command object
-% opINPUT_DEVICE_GET_TYPEMODE           Adds a INPUT_DEVICE opcode with a GET_TYPEMODE subcode to the command object
-% opINPUT_DEVICE_SET_TYPEMODE   @MMI:   Adds a INPUT_DEVICE opcode with a SET_TYPEMODE subcode to the command object
-% opINPUT_DEVICE_GET_SYMBOL             Adds a INPUT_DEVICE opcode with a GET_SYMBOL subcode to the command object
-% opINPUT_DEVICE_CLR_ALL                Adds a INPUT_DEVICE opcode with a CLR_ALL subcode to the command object
-% opINPUT_DEVICE_CLR_CHANGES    @MMI:   Adds a INPUT_DEVICE opcode with a CLR_CHANGES subcode to the command object
-% opINPUT_DEVICE_GET_NAME               Adds a INPUT_DEVICE opcode with a GET_NAME subcode to the command object
-% opINPUT_DEVICE_GET_MODENAME   @MMI:   Adds a INPUT_DEVICE opcode with a GET_MODENAME subcode to the command object
-% opINPUT_DEVICE_GET_CONNECTION @MMI:   Adds a INPUT_DEVICE opcode with GET_CONNECTION subcode to the command object
-% opINPUT_DEVICE_GET_MINMAX     @MMI:   Adds a INPUT_DEVICE opcode with a GET_MINMAX subcode to the command object 
-% opINPUT_DEVICE_GET_CHANGES    @MMI:   Adds a INPUT_DEVICE opcode with a GET_CHANGES subcode to the command object
-% opINPUT_DEVICE_GET_FORMAT     @MMI:   Adds a INPUT_DEVICE opcode with a GET_FORMAT subcode to the command object
-% opINPUT_DEVICE_GET_BUMPS      @MMI:   Adds a INPUT_DEVICE opcode with a GET_BUMPS subcode to the command object
-% opINPUT_READY                         Adds a opINPUT_READY opcode to the command object
-% opINPUT_TEST                  @MMI:   Adds a opINPUT_TEST opcode to the command object
-% opINPUT_READ                          Adds a opINPUT_READ opcode to the command object
-% opINPUT_READSI                        Adds a opINPUT_READSI opcode to the command object
-%
-% opOUTPUT_SET_TYPE         Adds a opOUTPUT_SET_TYPE opcode to the command object
-% opOUTPUT_RESET            Adds a opOUTPUT_RESET opcode to the command object
-% opOUTPUT_STOP             Adds a opOUTPUT_STOP opcode to the command object
-% opOUTPUT_SPEED            Adds a opOUTPUT_SPEED opcode to the command object
-% opOUTPUT_POWER            Adds a opOUTPUT_POWER opcode to the command object
-% opOUTPUT_START            Adds a opOUTPUT_START opcode to the command object
-% opOUTPUT_POLARITY         Adds a opOUTPUT_POLARITY opcode to the command object
-% opOUTPUT_READ             Adds a opOUTPUT_READ opcode to the command object
-% opOUTPUT_TEST             Adds a opOUTPUT_TEST opcode to the command object
-% opOUTPUT_READY            Adds a opOUTPUT_READY opcode to the command object
-% opOUTPUT_STEP_POWER       Adds a opOUTPUT_STEP_POWER opcode to the command object
-% opOUTPUT_TIME_POWER @MMI: Adds a opOUTPUT_TIME_POWER opcode to the command object
-% opOUTPUT_STEP_SPEED       Adds a opOUTPUT_STEP_SPEED opcode to the command object
-% opOUTPUT_TIME_SPEED       Adds a opOUTPUT_TIME_SPEED opcode to the command object
-% opOUTPUT_STEP_SYNC        Adds a opOUTPUT_STEP_SYNC opcode to the command object
-% opOUTPUT_TIME_SYNC        Adds a opOUTPUT_TIME_SYNC opcode to the command object
-% opOUTPUT_CLR_COUNT        Adds a opOUTPUT_CLR_COUNT opcode to the command object
-% opOUTPUT_GET_COUNT        Adds a opOUTPUT_GET_COUNT opcode to the command object
-%
-% opCOM_TEST  @MMI:         Adds a opCOM_TEST opcode to the command object    
-% opCOM_READY @MMI:         Adds a opCOM_READY opcode to the command object
-% opCOMGET_GET_BRICKNAME    Adds a opCOMGET opcode with a GET_BRICKNAME subcode to the command object
-% opCOMSET_SET_BRICKNAME    Adds a opCOMSET opcode with a SET_BRICKNAME subcode to the command object
-% opCOMGET_NETWORK @MMI:    Adds a opCOMGET opcode with a GET_NETWORK subcode to the command object
-% opCOMGET_ID @MMI:         Adds a opCOMGET opcode with a GET_ID subcode to the command object
-%
-% opMAILBOX_WRITE           Adds a opMAILBOX_WRITE opcode to the command object
-%
-% BEGIN_DOWNLOAD            Adds a BEGIN_DOWNLOAD system command to the command object
-% CONTINUE_DOWNLOAD         Adds a CONTINUE_DOWNLOAD system command to the command object
-% BEGIN_UPLOAD              Adds a BEGIN_UPLOAD system command to the command object
-% CONTINUE_UPLOAD           Adds a CONTINUE_UPLOAD system command to the command object
-% LIST_FILES                Adds a LIST_FILES system command to the command object
-% CONTINUE_LIST_FILES       Adds a CONTINUE_LIST_FILES system command to the command object
-% CREATE_DIR                Adds a CREATE_DIR system command to the command object
-% DELETE_FILE               Adds a DELETE_FILE system command to the command object
-% WRITEMAILBOX              Adds a WRITEMAILBOX system command to the command object
-% 
-% Notes::
-% - Refer to the EV3 documentation or source code for a more detailed
-% description of the commands.
-%
-% Example::
-%                   cmd = Command();
-%                   cmd.addHeaderDirect(42,0,0);
-%                   cmd.opSOUND_TONE(volume,frequency,duration);
-%                   cmd.addLength();
-
-
 classdef Command < handle
-
+    % EV3 command construction
+    %
+    % Methods::
+    % Command                   Constructor, creates an empty command object
+    % delete                    Destructor, clears the command object
+    %
+    % addHeaderSystem           Adds a system header to the command object
+    % addHeaderSystemReply      Adds a system header with reply to the command object
+    % addHeaderDirect           Adds a direct header to the command object
+    % addHeaderDirectReply      Adds a direct header with reply to the command object
+    % addLength                 Adds the length of the msg to the front of the command object
+    % addSystemCommand          Adds a system command to the command object
+    % addDirectCommand          Adds a direct command to the command object
+    %
+    % checkForError @MMI        Checks error byte in received package
+    % isCorrupt     @MMI        Checks whether reply packet is corrupt
+    %
+    % clear                     Clears the command msg
+    % display                   Displays the command msg (decimal)
+    % displayHex                Displays the command msg (hex)
+    %
+    % LC0                       Adds a local constant 0 to the command object
+    % LC1                       Adds a local constant 1 to the command object
+    % LC2                       Adds a local constant 2 to the command object
+    % LC4                       Adds a local constant 4 to the command object
+    % LV0                       Adds a local variable 0 to the command object
+    % GV0                       Adds a global variable 0 to the command object
+    % LCS                       Adds a local constant string to the command object
+    %
+    % addValue                  Adds a numerical value to the command object
+    % addArray                  Adds a numerical array to the command object
+    % addString                 Adds a string to the command object
+    % addLCSString              Adds a LCS string to the command object
+    %
+    % LONGToBytes               Adds a LONGToBytes to the command object
+    % WORDToBytes               Adds a WORDToBytes to the command object
+    % BYTEToBytes               Adds a BYTEToBytes to the command object
+    %
+    % PROGRAMHeader             Adds a PROGRAMHeader to the command object
+    % addFileSize               Adds the filesize to the command object
+    % VMTHREADHeader            Adds a VMTHREADHeader to the command object
+    % SUBCALLHeader             Adds a SUBCALLHeader to the command object
+    % BLOCKHeader               Adds a BLOCKHeader to the command object
+    % GenerateByteCode          Prints the command message to a file
+    %
+    % opNOP                     Adds a opNOP opcode to the command object
+    % opOBJECT_END              Adds a opOBJECT_END opcode to the command object
+    %
+    % opJR                      Adds a opJR opcode to the command object
+    %
+    % opUI_FLUSH                Adds a opUI_FLUSH opcode to the command object
+    %
+    % opUI_READ_GET_VBATT       Adds a opUI_READ opcode with a GET_VBATT subcode to the command object
+    % opUI_READ_GET_LBATT       Adds a opUI_READ opcode with a GET_LBATT subcode to the command object
+    %
+    % opUI_WRITE_PUT_STRING     Adds a opUI_WRITE opcode with a PUT_STRING subcode to the command object
+    % opUI_WRITE_INIT_RUN       Adds a opUI_WRITE opcode with a INIT_RUN subcode to the command object
+    % opUI_WRITE_LED            Adds a opUI_WRITE opcode with a LED subcode to the command object
+    %
+    % opUI_DRAW_UPDATE          Adds a opUI_DRAW opcode with a UPDATE subcode to the command object
+    % opUI_DRAW_CLEAN           Adds a opUI_DRAW opcode with a CLEAN subcode to the command object
+    % opUI_DRAW_PIXEL           Adds a opUI_DRAW opcode with a PIXEL subcode to the command object
+    % opUI_DRAW_LINE            Adds a opUI_DRAW opcode with a LINE subcode to the command object
+    % opUI_DRAW_CIRCLE          Adds a opUI_DRAW opcode with a CIRCLE subcode to the command object
+    % opUI_DRAW_TEXT            Adds a opUI_DRAW opcode with a TEXT subcode to the command object
+    % opUI_DRAW_VALUE           Adds a opUI_DRAW opcode with a VALUE subcode to the command object
+    % opUI_DRAW_FILLRECT        Adds a opUI_DRAW opcode with a FILLRECT subcode to the command object
+    % opUI_DRAW_RECT            Adds a opUI_DRAW opcode with a RECT subcode to the command object
+    % opUI_DRAW_INVERSERECT     Adds a opUI_DRAW opcode with a INVERSERECT subcode to the command object
+    % opUI_DRAW_SELECT_FONT     Adds a opUI_DRAW opcode with a SELECT_FONT subcode to the command object
+    % opUI_DRAW_TOPLINE         Adds a opUI_DRAW opcode with a TOPLINE subcode to the command object
+    % opUI_DRAW_FILLWINDOW      Adds a opUI_DRAW opcode with a FILLWINDOW subcode to the command object
+    % opUI_DRAW_FILLCIRCLE      Adds a opUI_DRAW opcode with a FILLCIRCLE subcode to the command object
+    % opUI_DRAW_STORE           Adds a opUI_DRAW opcode with a STORE subcode to the command object
+    % opUI_DRAW_RESTORE         Adds a opUI_DRAW opcode with a RESTORE subcode to the command object
+    %
+    % opTIMER_WAIT              Adds a opTIMER opcode with a WAIT subcode to the command object
+    % opTIMER_READY             Adds a opTIMER opcode with a READY subcode to the command object
+    % opTIMER_READ              Adds a opTIMER opcode with a READ subcode to the command object
+    %
+    % opSOUND_BREAK             Adds a opSOUND opcode with a BREAK subcode to the command object
+    % opSOUND_TONE              Adds a opSOUND opcode with a TONE subcode to the command object
+    % opSOUND_PLAY              Adds a opSOUND opcode with a PLAY subcode to the command object
+    % opSOUND_REPEAT            Adds a opSOUND opcode with a REPEAT subcode to the command object
+    % opSOUND_TEST              Adds a opSOUND opcode with a TEST subcode to the command object
+    % opSOUND_READY             Adds a opSOUND opcode with a READY subcode to the command object
+    %
+    % opINPUT_DEVICE_LIST                   Adds a INPUT_DEVICE opcode with a DEVICE_LIST subcode to the command object
+    % opINPUT_DEVICE_GET_TYPEMODE           Adds a INPUT_DEVICE opcode with a GET_TYPEMODE subcode to the command object
+    % opINPUT_DEVICE_SET_TYPEMODE   @MMI:   Adds a INPUT_DEVICE opcode with a SET_TYPEMODE subcode to the command object
+    % opINPUT_DEVICE_GET_SYMBOL             Adds a INPUT_DEVICE opcode with a GET_SYMBOL subcode to the command object
+    % opINPUT_DEVICE_CLR_ALL                Adds a INPUT_DEVICE opcode with a CLR_ALL subcode to the command object
+    % opINPUT_DEVICE_CLR_CHANGES    @MMI:   Adds a INPUT_DEVICE opcode with a CLR_CHANGES subcode to the command object
+    % opINPUT_DEVICE_GET_NAME               Adds a INPUT_DEVICE opcode with a GET_NAME subcode to the command object
+    % opINPUT_DEVICE_GET_MODENAME   @MMI:   Adds a INPUT_DEVICE opcode with a GET_MODENAME subcode to the command object
+    % opINPUT_DEVICE_GET_CONNECTION @MMI:   Adds a INPUT_DEVICE opcode with GET_CONNECTION subcode to the command object
+    % opINPUT_DEVICE_GET_MINMAX     @MMI:   Adds a INPUT_DEVICE opcode with a GET_MINMAX subcode to the command object 
+    % opINPUT_DEVICE_GET_CHANGES    @MMI:   Adds a INPUT_DEVICE opcode with a GET_CHANGES subcode to the command object
+    % opINPUT_DEVICE_GET_FORMAT     @MMI:   Adds a INPUT_DEVICE opcode with a GET_FORMAT subcode to the command object
+    % opINPUT_DEVICE_GET_BUMPS      @MMI:   Adds a INPUT_DEVICE opcode with a GET_BUMPS subcode to the command object
+    % opINPUT_READY                         Adds a opINPUT_READY opcode to the command object
+    % opINPUT_TEST                  @MMI:   Adds a opINPUT_TEST opcode to the command object
+    % opINPUT_READ                          Adds a opINPUT_READ opcode to the command object
+    % opINPUT_READSI                        Adds a opINPUT_READSI opcode to the command object
+    %
+    % opOUTPUT_SET_TYPE         Adds a opOUTPUT_SET_TYPE opcode to the command object
+    % opOUTPUT_RESET            Adds a opOUTPUT_RESET opcode to the command object
+    % opOUTPUT_STOP             Adds a opOUTPUT_STOP opcode to the command object
+    % opOUTPUT_SPEED            Adds a opOUTPUT_SPEED opcode to the command object
+    % opOUTPUT_POWER            Adds a opOUTPUT_POWER opcode to the command object
+    % opOUTPUT_START            Adds a opOUTPUT_START opcode to the command object
+    % opOUTPUT_POLARITY         Adds a opOUTPUT_POLARITY opcode to the command object
+    % opOUTPUT_READ             Adds a opOUTPUT_READ opcode to the command object
+    % opOUTPUT_TEST             Adds a opOUTPUT_TEST opcode to the command object
+    % opOUTPUT_READY            Adds a opOUTPUT_READY opcode to the command object
+    % opOUTPUT_STEP_POWER       Adds a opOUTPUT_STEP_POWER opcode to the command object
+    % opOUTPUT_TIME_POWER @MMI: Adds a opOUTPUT_TIME_POWER opcode to the command object
+    % opOUTPUT_STEP_SPEED       Adds a opOUTPUT_STEP_SPEED opcode to the command object
+    % opOUTPUT_TIME_SPEED       Adds a opOUTPUT_TIME_SPEED opcode to the command object
+    % opOUTPUT_STEP_SYNC        Adds a opOUTPUT_STEP_SYNC opcode to the command object
+    % opOUTPUT_TIME_SYNC        Adds a opOUTPUT_TIME_SYNC opcode to the command object
+    % opOUTPUT_CLR_COUNT        Adds a opOUTPUT_CLR_COUNT opcode to the command object
+    % opOUTPUT_GET_COUNT        Adds a opOUTPUT_GET_COUNT opcode to the command object
+    %
+    % opCOM_TEST  @MMI:         Adds a opCOM_TEST opcode to the command object    
+    % opCOM_READY @MMI:         Adds a opCOM_READY opcode to the command object
+    % opCOMGET_GET_BRICKNAME    Adds a opCOMGET opcode with a GET_BRICKNAME subcode to the command object
+    % opCOMSET_SET_BRICKNAME    Adds a opCOMSET opcode with a SET_BRICKNAME subcode to the command object
+    % opCOMGET_NETWORK @MMI:    Adds a opCOMGET opcode with a GET_NETWORK subcode to the command object
+    % opCOMGET_ID @MMI:         Adds a opCOMGET opcode with a GET_ID subcode to the command object
+    %
+    % opMAILBOX_WRITE           Adds a opMAILBOX_WRITE opcode to the command object
+    %
+    % BEGIN_DOWNLOAD            Adds a BEGIN_DOWNLOAD system command to the command object
+    % CONTINUE_DOWNLOAD         Adds a CONTINUE_DOWNLOAD system command to the command object
+    % BEGIN_UPLOAD              Adds a BEGIN_UPLOAD system command to the command object
+    % CONTINUE_UPLOAD           Adds a CONTINUE_UPLOAD system command to the command object
+    % LIST_FILES                Adds a LIST_FILES system command to the command object
+    % CONTINUE_LIST_FILES       Adds a CONTINUE_LIST_FILES system command to the command object
+    % CREATE_DIR                Adds a CREATE_DIR system command to the command object
+    % DELETE_FILE               Adds a DELETE_FILE system command to the command object
+    % WRITEMAILBOX              Adds a WRITEMAILBOX system command to the command object
+    % 
+    % Notes::
+    % - Refer to the EV3 documentation or source code for a more detailed
+    % description of the commands.
+    %
+    % Example::
+    %                   cmd = Command();
+    %                   cmd.addHeaderDirect(42,0,0);
+    %                   cmd.opSOUND_TONE(volume,frequency,duration);
+    %                   cmd.addLength();
+    %
     % Communications format (c_com.h):
     % /*
     %       System Command Bytes:
diff --git a/source/CommunicationInterface.m b/source/CommunicationInterface.m
index 1ff20263cdaa257fa33d934caad76def9f3ad510..8c47af53aeb0167a4474403e9f7324ff852fb348 100755
--- a/source/CommunicationInterface.m
+++ b/source/CommunicationInterface.m
@@ -1,201 +1,151 @@
-% Brick Interface to Lego Minstorms EV3 brick
-%
-% Methods::
-% brick                 Constructor, establishes communications
-% delete                Destructor, closes connection
-% send                  Send data to the brick
-% receive               Receive data from the brick
-% 
-%
-% uiReadVBatt           Returns battery level as a voltage
-% uiReadLBatt           Returns battery level as a percentage
-%
-% drawTest              Shows the drawing capabilities of the brick
-%
-%
-% soundTest     @MMI:   Returns state of speaker
-% soundReady	@MMI:   Halts the execution of commands on Brick until speakers are ready
-% soundPlayTone         Plays a tone at a volume with a frequency and duration
-% soundStopTone @MMI:   Stops current sound playback
-%
-% beep                  Plays a beep tone with volume and duration
-% playThreeTone         Plays three tones one after the other
-%
-%
-% inputDeviceList          @MMI:    Returns list of sensor types on each port
-% inputDeviceGetName                Returns the device name at a layer and NO
-% inputDeviceGetTypeMode   @MMI:    Returns type and mode of device at a layer and NO
-% inputDeviceSetTypeMode   @MMI:    Sets type and mode of device which is recognized by old
-%                                   type and mode.
-% inputDeviceGetModeName   @MMI:    Returns the device's mode at a layer and NO
-% inputDeviceGetConnection @MMI:	Returns the connection type (=sensor type) at a layer and NO
-% inputDeviceGetMinMax     @MMI:	Returns the min and max SI value of device at a layer and NO
-% inputDeviceGetChanges    @MMI:	Returns positive changes(=button releases) since last clear at a layer and NO
-% inputDeviceGetFormat     @MMI:	Returns no. of datasets, returned data type in
-%                                   active sensor mode, no. of sensor modes and no. of
-%                                   visible sensor modes at a layer and NO
-% inputDeviceGetBumps      @MMI:    Returns negatives changes (=button presses) since last clear at a layer and NO
-% inputDeviceSymbol                 Returns the symbol for the device at a layer, NO and mode
-% inputDeviceClrChanges    @MMI:    Clears changes(&bumps) at a layer and NO
-% inputDeviceClrAll                 Clears all the sensor data at a layer
-% inputReady               @MMI:    Halts the execution of commands on Brick until given devices are ready
-% inputTest                @MMI:    Returns the state of the device at a layer and NO
-% inputRead                @MMI:    Reads a connected sensor at a layer, NO, type and mode in percentage
-% inputReadSI                       Reads a connected sensor at a layer, NO, type and mode in SI units
-%
-% plotSensor            Plots a sensor readings over time
-% displayColor          Displays the color from a color sensor
-%
-%
-% outputStop            Stops motor at a layer, NOS and brake
-% outputStopAll         Stops all the motors
-% outputPower           Sets motor output power at a layer, NOS and speed
-% outputSpeed     @MMI: Sets motor output speed at a layer, NOS and speed
-% outputStart           Starts motor at a layer, NOS and speed
-% outputTest            Returns the state of the motor at a layer and NOS
-% outputStepSpeed       Moves a motor to set position with layer, NOS, speed, 
-%                       ramp up angle, constant angle, ramp down angle and brake
-% outputStepPower @MMI: Moves a motor to set position with layer, NOS, power,
-%                       ramp up angle, constant angle, ramp down angle and brake
-% outputTimeSpeed @MMI: Moves a motor for set time at a layer, NOS, speed,
-%                       ramp up time, constant time, ramp down time and brake
-% outputTimePower @MMI: Moves a motor for set time at a layer, NOS, power,
-%                       ramp up time, constant time, ramp down time and brake
-% outputStepSync  @MMI: Moves two motors synchronized at a layer, NOS,
-%                       power, turn ratio, tacho limit, and brake 
-% outputTimeSync  @MMI: Moves two motors synchronized at a layer, NOS,
-%                       power, turn ratio, time limit, and brake 
-% outputClrCount        Clears a motor tachometer at a  layer and NOS
-% outputGetCount        Returns the tachometer at a layer and NO
-% outputReset     @MMI: 
-% outputRead      @MMI: 
-% outputPolarity  @MMI: Sets a motor's polarity ('rotational direction')
-% outputReady     @MMI: Halts the execution of commands on Brick until given
-%                       motors have stopped
-%
-%
-% comTest  @MMI:        Returns state of communication adapter of device.
-% comReady @MMI:        Halts the execution of commands of Brick until
-%                       communication adapter is ready
-% comGetBrickName       Returns the name of the brick
-% comSetBrickName       Sets the name of the brick
-% comGetMACAddress@MMI: Returns the MAC-address of the brick
-% comGetBTID      @MMI: Returns BT-address information
-%
-% mailBoxWrite          Writes a mailbox message from the brick to another device
-% fileUpload            Uploads a file to the brick
-% fileDownload          Downloads a file from the brick
-% listFiles             Lists files on the brick from a directory  
-% createDir             Creates a directory on the brick
-% deleteFile            Deletes a file from the brick
-% writeMailBox          Writes a mailbox message to the brick
-% readMailBox           Reads a mailbox message sent from the brick
-%
-%
-% threeToneByteCode     Generates the bytecode for the playThreeTone function 
-%
-% Example::
-%           b = Brick('ioType','usb')
-%           b = Brick('ioType','wifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')
-%           b = Brick('ioType','bt','serPort','/dev/rfcomm0')
-
-
 classdef CommunicationInterface < handle
-    
+    % Brick Interface to Lego Minstorms EV3 brick
+    %
+    % Methods::
+    % brick                 Constructor, establishes communications
+    % delete                Destructor, closes connection
+    % send                  Send data to the brick
+    % receive               Receive data from the brick
+    % 
+    %
+    % uiReadVBatt           Returns battery level as a voltage
+    % uiReadLBatt           Returns battery level as a percentage
+    %
+    % drawTest              Shows the drawing capabilities of the brick
+    %
+    %
+    % soundTest     @MMI:   Returns state of speaker
+    % soundReady	@MMI:   Halts the execution of commands on Brick until speakers are ready
+    % soundPlayTone         Plays a tone at a volume with a frequency and duration
+    % soundStopTone @MMI:   Stops current sound playback
+    %
+    % beep                  Plays a beep tone with volume and duration
+    % playThreeTone         Plays three tones one after the other
+    %
+    %
+    % inputDeviceList          @MMI:    Returns list of sensor types on each port
+    % inputDeviceGetName                Returns the device name at a layer and NO
+    % inputDeviceGetTypeMode   @MMI:    Returns type and mode of device at a layer and NO
+    % inputDeviceSetTypeMode   @MMI:    Sets type and mode of device which is recognized by old
+    %                                   type and mode.
+    % inputDeviceGetModeName   @MMI:    Returns the device's mode at a layer and NO
+    % inputDeviceGetConnection @MMI:	Returns the connection type (=sensor type) at a layer and NO
+    % inputDeviceGetMinMax     @MMI:	Returns the min and max SI value of device at a layer and NO
+    % inputDeviceGetChanges    @MMI:	Returns positive changes(=button releases) since last clear at a layer and NO
+    % inputDeviceGetFormat     @MMI:	Returns no. of datasets, returned data type in
+    %                                   active sensor mode, no. of sensor modes and no. of
+    %                                   visible sensor modes at a layer and NO
+    % inputDeviceGetBumps      @MMI:    Returns negatives changes (=button presses) since last clear at a layer and NO
+    % inputDeviceSymbol                 Returns the symbol for the device at a layer, NO and mode
+    % inputDeviceClrChanges    @MMI:    Clears changes(&bumps) at a layer and NO
+    % inputDeviceClrAll                 Clears all the sensor data at a layer
+    % inputReady               @MMI:    Halts the execution of commands on Brick until given devices are ready
+    % inputTest                @MMI:    Returns the state of the device at a layer and NO
+    % inputRead                @MMI:    Reads a connected sensor at a layer, NO, type and mode in percentage
+    % inputReadSI                       Reads a connected sensor at a layer, NO, type and mode in SI units
+    %
+    % outputStop            Stops motor at a layer, NOS and brake
+    % outputStopAll         Stops all the motors
+    % outputPower           Sets motor output power at a layer, NOS and speed
+    % outputSpeed     @MMI: Sets motor output speed at a layer, NOS and speed
+    % outputStart           Starts motor at a layer, NOS and speed
+    % outputTest            Returns the state of the motor at a layer and NOS
+    % outputStepSpeed       Moves a motor to set position with layer, NOS, speed, 
+    %                       ramp up angle, constant angle, ramp down angle and brake
+    % outputStepPower @MMI: Moves a motor to set position with layer, NOS, power,
+    %                       ramp up angle, constant angle, ramp down angle and brake
+    % outputTimeSpeed @MMI: Moves a motor for set time at a layer, NOS, speed,
+    %                       ramp up time, constant time, ramp down time and brake
+    % outputTimePower @MMI: Moves a motor for set time at a layer, NOS, power,
+    %                       ramp up time, constant time, ramp down time and brake
+    % outputStepSync  @MMI: Moves two motors synchronized at a layer, NOS,
+    %                       power, turn ratio, tacho limit, and brake 
+    % outputTimeSync  @MMI: Moves two motors synchronized at a layer, NOS,
+    %                       power, turn ratio, time limit, and brake 
+    % outputClrCount        Clears a motor tachometer at a  layer and NOS
+    % outputGetCount        Returns the tachometer at a layer and NO
+    % outputReset     @MMI: 
+    % outputRead      @MMI: 
+    % outputPolarity  @MMI: Sets a motor's polarity ('rotational direction')
+    % outputReady     @MMI: Halts the execution of commands on Brick until given
+    %                       motors have stopped
+    %
+    %
+    % comTest  @MMI:        Returns state of communication adapter of device.
+    % comReady @MMI:        Halts the execution of commands of Brick until
+    %                       communication adapter is ready
+    % comGetBrickName       Returns the name of the brick
+    % comSetBrickName       Sets the name of the brick
+    % comGetMACAddress@MMI: Returns the MAC-address of the brick
+    % comGetBTID      @MMI: Returns BT-address information
+    %
+    % mailBoxWrite          Writes a mailbox message from the brick to another device
+    % fileUpload            Uploads a file to the brick
+    % fileDownload          Downloads a file from the brick
+    % listFiles             Lists files on the brick from a directory  
+    % createDir             Creates a directory on the brick
+    % deleteFile            Deletes a file from the brick
+    % writeMailBox          Writes a mailbox message to the brick
+    % readMailBox           Reads a mailbox message sent from the brick
+    %
+    %
+    % threeToneByteCode     Generates the bytecode for the playThreeTone function 
+    %
+    % Example::
+    %           b = Brick('ioType','usb')
+    %           b = Brick('ioType','wifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')
+    %           b = Brick('ioType','bt','serPort','/dev/rfcomm0')
+
     properties
         % Debug 
         debug;
     end
     
-    properties (SetAccess = 'private')
+    properties (Dependent)
+        % Time-out period in seconds (if 0, no time-out)
+        timeOut; 
+    end
+    
+    properties (SetAccess = private)
         % IO connection type
         ioType;
-        % Bluetooth brick device name
-        btDevice = '';
-        % Bluetooth brick communication channel
-        btChannel = 0;
-        % Wifi brick IP address
-        wfAddr = '';
-        % Wifi brick TCP port
-        wfPort = ''; 
-        % Brick serial number
-        wfSN = ''; 
-        % Bluetooth serial port
-        serPort;
     end
     
-    properties (Hidden, Access = 'private')
+    properties (Hidden, Access = private)
         % Connection handle
         conn; 
     end
     
     methods
+        %% Constructor, Destructor, Setter...
         function commInterface = CommunicationInterface(varargin) 
-             % Brick.Brick Create a Brick object
+             % CommunicationInterface.CommunicationInterface Create a CommunicationInterface object
              %
-             % b = Brick(OPTIONS) is an object that represents a connection
+             % b = CommunicationInterface(...) is an object that represents a connection
              % interface to a Lego Mindstorms EV3 brick.
              %
-             % Options::
-             %  'debug',D       Debug level, show communications packet
-             %  'ioType',P      IO connection type, either usb, wifi or bt
-             %  'btDevice',bt   Bluetooth brick device name
-             %  'btChannel',cl  Bluetooth connection channel
-             %  'wfAddr',wa     Wifi brick IP address
-             %  'wfPort',pr     Wifi brick TCP port, default 5555
-             %  'wfSN',sn       Wifi brick serial number (found under Brick info on the brick OR through sniffing the UDP packets the brick emits on port 3015)
-             %  'serPort',SP    Serial port connection
-             %
              % Notes::
-             % - Can connect through: usbBrickIO, wfBrickIO, btBrickIO or
-             % instrBrickIO.
-             % - For usbBrickIO:
-             %      b = Brick('ioType','usb')
-             % - For wfBrickIO:
-             %      b = Brick('ioType','wifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')
-             % - For btBrickIO:
-             %      b = Brick('ioType','bt','serPort','/dev/rfcomm0')
-             % - For instrBrickIO (wifi)
-             %      b = Brick('ioType','instrwifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')
-             % - For instrBrickIO (bluetooth)
-             %      b = Brick('ioType','instrbt','btDevice','EV3','btChannel',1)
+             % - Can connect through: usbBrickIO, btBrickIO
+             % - For USB connection:
+             %      b = CommunicationInterface('usb')
+             % - For BT connection on linux/mac:
+             %      b = CommunicationInterface('bt','serPort','/dev/rfcomm0')
+             % - For BT conenction on windows:
+             %      b = CommunicationInterface('bt','backend','instrumentControl,'channel',1,'deviceName','EV3')
+             
+             props = commInterface.evaluateProperties(varargin{:});
+             commInterface.ioType = props.ioType;
+             commInterface.debug = props.debug;
              
-             commInterface.setProperties(varargin{:});
-%              % Init the properties
-%              opt.debug = 0;
-%              opt.btDevice = 'EV3';
-%              opt.btChannel = 1;
-%              opt.wfAddr = '192.168.1.104';
-%              opt.wfPort = 5555;
-%              opt.wfSN = '0016533dbaf5';
-%              opt.ioType = 'usb';
-%              opt.serPort = '/dev/rfcomm0';
-%              
-%              % Read in the options
-%              opt = tb_optparse(opt, varargin);
-%              commInterface.debug = opt.debug;
-%              commInterface.ioType = opt.ioType;
-
              try
                  if(strcmp(commInterface.ioType,'usb')) % USB
-                    commInterface.conn = usbBrickIO(commInterface.debug);
-                 elseif(strcmp(commInterface.ioType,'wifi')) % WiFi
-                    commInterface.wfAddr = opt.wfAddr;
-                    commInterface.wfPort = opt.wfPort;
-                    commInterface.wfSN = opt.wfSN;
-                    commInterface.conn = wfBrickIO(commInterface.debug,commInterface.wfAddr,commInterface.wfPort,commInterface.wfSN);
+                    commInterface.conn = usbBrickIO(props.debug);
                  elseif(strcmp(commInterface.ioType,'bt')) % Bluetooth
-%                     commInterface.serPort = opt.serPort;
-                    commInterface.conn = btBrickIO(commInterface.debug,commInterface.serPort);
-                 elseif(strcmp(commInterface.ioType,'instrwifi')) % Instrumentation and Control: WiFi 
-                    commInterface.wfAddr = opt.wfAddr;
-                    commInterface.wfPort = opt.wfPort;
-                    commInterface.wfSN = opt.wfSN;
-                    commInterface.conn = instrBrickIO(commInterface.debug,'wf',commInterface.wfAddr,commInterface.wfPort,commInterface.wfSN);
-                 elseif(strcmp(commInterface.ioType,'instrbt')) % Instrumentation and Control: Bluetooth 
-                    commInterface.btDevice = opt.btDevice;
-                    commInterface.btChannel = opt.btChannel;
-                    commInterface.conn = instrBrickIO(commInterface.debug,'bt',commInterface.btDevice,commInterface.btChannel);
+                    if(strcmp(props.backend, 'serial'))
+                       commInterface.conn = btBrickIO('debug', props.debug, 'serPort', props.serPort);
+                    else
+                       commInterface.conn = btBrickIO('debug', props.debug, 'backend', props.backend, 'channel', props.channel, 'deviceName', props.deviceName);
+                    end
                  end
              catch ME
                  commInterface.conn = [];
@@ -219,148 +169,55 @@ classdef CommunicationInterface < handle
             brick.conn.debug = debug;
         end
         
-        function setProperties(brick, varargin)
+        function set.timeOut(brick, timeOut)
+            if ~isnumeric(timeOut) || timeOut < 0
+                error(ID(), 'timeOut-period of USB-handle can only be set to positive numerical values.'); 
+            end
+            
+            brick.conn.timeOut = timeOut;
+        end
+        function timeOut = get.timeOut(brick)
+            timeOut = brick.conn.timeOut; 
+        end
+        
+        function props = evaluateProperties(brick, varargin)
             p = inputParser();
             p.KeepUnmatched = true;
             
             % Set default values
             defaultIOType = 'usb';
             defaultSerPort = '/dev/rfcomm0';
+            defaultBTDevice = 'EV3';
+            defaultBTChannel = 1;
+            if(ispc && license('test', 'instr_control_toolbox'))
+                defaultBackend = 'instrumentControl';
+            else
+                defaultBackend = 'serial';
+            end
             defaultDebug = false;
             
-            % Define anonymous function that will return whether given value in varargin is valid
-            %validTypes = ;
+            % Define anonymous functions that will return whether given value in varargin is valid
             checkIOType = @(x) ismember(x, {'usb', 'bt'});
             checkDebug = @(x) isBool(x);
+            checkBackend = @(x) ismember(x, {'serial', 'instrumentControl'});
             
             % Add parameters
             p.addRequired('ioType', checkIOType);
             p.addOptional('serPort', defaultSerPort);
             p.addOptional('debug', defaultDebug, checkDebug);
+            p.addOptional('deviceName', defaultBTDevice);
+            p.addOptional('channel', defaultBTChannel);
+            p.addOptional('backend', defaultBackend, checkBackend);
             
             % Parse input...
             p.parse(varargin{:});
             
-            % Set properties
-            brick.ioType = p.Results.ioType;
-            brick.serPort = p.Results.serPort;
-            brick.debug = p.Results.debug;
-        end
-        
-        function send(brick, cmd)
-            % Brick.send Send data to the brick
-            %
-            % Brick.send(cmd) sends a command to the brick through the
-            % connection handle.
-            %
-            % Notes::
-            % - cmd is a command object.
-            %
-            % Example::
-            %           b.send(cmd)
-            
-            % Send the message through the brickIO write function
-            brick.conn.write(cmd.msg);
-            
-            % (MMI) When spamming the brick with commands, at some point, it will start
-            % behaving 'strange'. Sometimes, commands will be executed only with 
-            % a delay, some commands may even be bypassed. 
-            % (Maybe too many commands screw up the brick's internal command queue?..)
-            % Temporary workaround: Wait 5ms after each sent packet. 
-            pause(0.005);
-            
-            % Verbose output
-            if brick.debug > 0
-               fprintf('sent (hex):    [ ');
-               for ii=1:length(cmd.msg)
-                   fprintf('%s ',dec2hex(cmd.msg(ii)))
-               end
-               fprintf(']\n');
-               fprintf('sent (dec):    [ ');
-               for ii=1:length(cmd.msg)
-                   fprintf('%d ',cmd.msg(ii))
-               end
-               fprintf(']\n');
-            end
-        end
-       
-        function rmsg = receive(brick)
-            % Brick.receive Receive data from the brick
-            %
-            % rmsg = Brick.receive() receives data from the brick through
-            % the connection handle.
-            %
-            % Notes: 
-            %  - If received packet is corrupt, up to five new packets are read (if all are 
-            %    corrupt, an error is thrown) 
-            %
-            % Example::
-            %           rmsg = b.receive()
-            %
-            
-            % Read the message through the brickIO read function
-            rmsg = brick.conn.read();
-            
-            % Check if reply is corrupt or error byte is set
-            try
-                reply = Command(rmsg);
-            catch ME
-                corrupt = 1;
-                if ~isempty(strfind(ME.identifier, 'CorruptPacket'))
-                    % Read packet was corrupt - retry
-                    %id = [ID(), ':', 'CorruptPacket'];
-                    %warning(id, 'Read corrupt packet. Retrying...');
-                    if brick.debug
-                        fprintf('received (corrupt) (hex):    [ ');
-                        for ii=1:length(rmsg)
-                            fprintf('%s ',dec2hex(rmsg(ii)))
-                        end
-                        fprintf(']\n');
-                        fprintf('received (corrupt) (dec):    [ ');
-                        for ii=1:length(rmsg)
-                            fprintf('%d ',rmsg(ii))
-                        end
-                        fprintf(']\n');
-                    end
-                    
-                    retries = 5;
-                    while corrupt && retries
-                        rmsg = brick.conn.read();
-                        try
-                            reply = Command(rmsg);
-                            corrupt = 0;
-                        catch
-                            retries = retries-1;
-                        end
-                    end
-                end
-                
-                if corrupt
-                    rethrow(ME);
-                end
-            end
-            
-            if reply.checkForError()
-                msg = 'Error byte is set. The Brick couldn''t handle the last packet';
-                id = [ID(), ':', 'CommandError'];
-                warning(id, msg);
-            end
-            
-            % Verbose output
-            if brick.debug > 0
-               fprintf('received (hex):    [ ');
-               for ii=1:length(rmsg)
-                   fprintf('%s ',dec2hex(rmsg(ii)))
-               end
-               fprintf(']\n');
-               fprintf('received (dec):    [ ');
-               for ii=1:length(rmsg)
-                   fprintf('%d ',rmsg(ii))
-               end
-               fprintf(']\n');
-            end      
+            props = p.Results;
         end
         
+        %% Commands
+        % Methods in this block each correspond to a certain opCode which is implemented in the
+        % EV3 firmware -> each method creates one packet and sends it.
         function voltage = uiReadVbatt(brick)
             % Brick.uiReadVbatt Return battery level (voltage)
             % 
@@ -375,7 +232,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             voltage = typecast(uint8(msg(6:9)),'single');           
             if brick.debug > 0
                 fprintf('Battery voltage: %.02fV\n', voltage);
@@ -397,81 +255,14 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             level = msg(6);
             if brick.debug > 0
                 fprintf('Battery level: %d%%\n', level);
             end
         end
         
-        function drawTest(brick)
-            % Brick.drawTest Draw test shapes
-            %
-            % Brick.drawTest() shows the drawing capabilities of the brick.
-            %
-            % Example::
-            %           b.drawTest()
-            
-            cmd = Command();
-            cmd.addHeaderDirect(42,4,1);
-            % save the UI screen
-            cmd.opUI_DRAW_STORE(0);
-            % change the led pattern
-            cmd.opUI_WRITE_LED(Device.LedGreenFlash);
-            % clear the screen (top line still remains with remote cmds)
-            cmd.opUI_DRAW_FILLWINDOW(0,0,0);
-            % draw four pixels
-            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,12,15);
-            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,12,20);
-            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,18,15);
-            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,18,20);
-            % draw line
-            cmd.opUI_DRAW_LINE(vmCodes.vmFGColor,0,25,vmCodes.vmLCDWidth,25);
-            cmd.opUI_DRAW_LINE(vmCodes.vmFGColor,15,25,15,127);
-            % draw circle
-            cmd.opUI_DRAW_CIRCLE(1,40,40,10);
-            % draw rectangle
-            cmd.opUI_DRAW_RECT(vmCodes.vmFGColor,70,30,20,20);
-            % draw filled cricle
-            cmd.opUI_DRAW_FILLCIRCLE(vmCodes.vmFGColor,40,70,10);
-            % draw filled rectangle
-            cmd.opUI_DRAW_FILLRECT(vmCodes.vmFGColor,70,60,20,20);
-            % draw inverse rectangle
-            cmd.opUI_DRAW_INVERSERECT(30,90,60,20);
-            % change font
-            cmd.opUI_DRAW_SELECT_FONT(2);
-            % draw text
-            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,40,'EV3');
-            % change font
-            cmd.opUI_DRAW_SELECT_FONT(1);
-            % reprint
-            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,70,'EV3');
-            % change font
-            cmd.opUI_DRAW_SELECT_FONT(0);
-            % reprint
-            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,90,'EV3');
-            % voltage string
-            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,110,'v =');
-            % store voltage
-            cmd.opUI_READ_GET_VBATT(0);
-            % print the voltage value (global)
-            cmd.opUI_DRAW_VALUE(vmCodes.vmFGColor,130,110,0,5,3);
-            % update the window
-            cmd.opUI_DRAW_UPDATE;
-            % 5 second timer (so you can see the changing LED pattern)
-            cmd.opTIMER_WAIT(5000,0);
-            % wait for timer
-            cmd.opTIMER_READY(0);
-            % reset the LED
-            cmd.opUI_WRITE_LED(Device.LedGreen);
-            % return UI screen
-            cmd.opUI_DRAW_RESTORE(0);
-            % return
-            cmd.opUI_DRAW_UPDATE;
-            cmd.addLength();
-            brick.send(cmd)
-        end
-        
         % Implemented @ MMI
         function state = soundTest(brick)
             % Brick.soundTest Test speaker
@@ -492,7 +283,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the state
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % speaker state is the 6th byte
             state = msg(6);    
         end
@@ -513,7 +305,7 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);  
             % receive reply 
-            brick.receive();           
+            brick.waitForReply();           
         end
         
         function soundPlayTone(brick, volume, frequency, duration)  
@@ -552,52 +344,7 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);            
         end
-                 
-        function beep(brick,volume,duration)
-            % Brick.beep Play a beep on the brick
-            %
-            % Brick.beep(volume,duration) plays a beep tone with volume and
-            % duration.
-            %
-            % Notes::
-            % - volume is the beep volume from 0 to 100, by default 10. (DATA8)
-            % - duration is the beep duration in ms, by default 100. (DATA16)
-            %
-            % Example:: 
-            %           b.beep(5,500)
-            
-            if nargin < 2
-                volume = 10;
-            end
-            if nargin < 3
-                duration = 100;
-            end
-            brick.soundPlayTone(volume, 1000, duration);
-        end
-        
-        function playThreeTones(brick)
-            % Brick.playThreeTones Play three tones on the brick
-            %
-            % Brick.playThreeTones() plays three tones consequentively on
-            % the brick with one upload command.
-            %
-            % Example::
-            %           b.playThreeTones();
-            
-            cmd = Command();
-            cmd.addHeaderDirect(42,0,0);
-            cmd.opSOUND_TONE(5,440,500);
-            cmd.opSOUND_READY();
-            cmd.opSOUND_TONE(10,880,500);
-            cmd.opSOUND_READY();
-            cmd.opSOUND_TONE(15,1320,500);
-            cmd.opSOUND_READY();
-            cmd.addLength();
-            % print message
-            fprintf('Sending three tone message ...\n');
-            brick.send(cmd);    
-        end
-        
+          
         % Implemented @ MMI
         function types = inputDeviceList(brick)
             % Brick.inputDeviceList Get an array of sensor types 
@@ -618,7 +365,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the type array
             types = [msg(6), msg(7), msg(8), msg(9)];
         end
@@ -644,7 +392,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the device name
             name = sscanf(char(msg(6:end)),'%s');
         end
@@ -672,7 +421,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the type and mode
             type = msg(6);
             mode = msg(7);
@@ -712,7 +462,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the mode name
             mode = sscanf(char(msg(6:end)),'%s');
         end
@@ -742,7 +493,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the connection type
             conn = msg(6);
         end
@@ -769,7 +521,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the values
             min = typecast(uint8(msg(6:9)),'single');
             max = typecast(uint8(msg(10:13)),'single');
@@ -801,7 +554,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the changes
             changes = typecast(uint8(msg(6:9)),'single');
             if brick.debug > 0
@@ -837,7 +591,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the data
             datasets = msg(6);
             format = msg(7);
@@ -867,7 +622,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the bumps
             bumps = typecast(uint8(msg(6:9)),'single');
             if brick.debug > 0
@@ -897,7 +653,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the symbol name
             name = sscanf(char(msg(6:end)),'%s');
         end
@@ -965,7 +722,7 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive reply
-            brick.receive();            
+            brick.waitForReply();            
         end
         
         % Implemented @ MMI
@@ -990,7 +747,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the state
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % device state is the 6th (final) byte
             state = msg(6);
         end
@@ -1024,11 +782,12 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             reading = msg(6);
-            if brick.debug > 0
-                 fprintf('Sensor reading: %.02f\n', reading);
-            end
+%             if brick.debug > 0
+%                  fprintf('Sensor reading: %.02f\n', reading);
+%             end
         end
         
         function reading = inputReadSI(brick,layer,no,mode)
@@ -1054,11 +813,12 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             reading = typecast(uint8(msg(6:9)),'single');
-            if brick.debug > 0
-                 fprintf('Sensor reading: %.02f\n', reading);
-            end
+%             if brick.debug > 0
+%                  fprintf('Sensor reading: %.02f\n', reading);
+%             end
         end
         
         function reading = inputReadSIType(brick,layer,no,type,mode)
@@ -1084,111 +844,12 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             reading = typecast(uint8(msg(6:9)),'single');
-            if brick.debug > 0
-                 fprintf('Sensor reading: %.02f\n', reading);
-            end
-        end
-        
-        function plotSensor(brick,layer,no,mode)
-            % Brick.plotSensor plot the sensor output 
-            %
-            % Brick.plotSensor(layer,no,mode) plots the sensor output
-            % to MATLAB. 
-            %
-            % Notes::
-            % - layer is the usb chain layer (usually 0).
-            % - NO is the output port number from [0..3] or sensor port
-            % number minus 1.
-            % - mode is the sensor mode from types.html. (-1=don't change)
-            %
-            % Example::
-            %           b.plotSensor(0,SensorPort.Sensor1,Device.USDistCM)
-            %           b.plotSensor(0,SensorPort.Sensor1,Device.GyroAng)
-            
-            % start timing
-            tic;
-            % create figure
-            hfig = figure('name','EV3 Sensor');
-            % init the the data
-            t = 0;
-            x = 0;
-            hplot = plot(t,x);
-            % one read to set the mode
-            reading = brick.inputReadSI(layer,no,mode);
-            % set the title
-            name = brick.inputDeviceGetName(layer,no);
-            title(['Device name: ' name]);
-            % set the y label
-            name = brick.inputDeviceSymbol(layer,no);
-            ylabel(['Sensor value (' name(1:end-1) ')']);
-            % set the x label
-            xlabel('Time (s)');
-            % set the x axis
-            xlim([0 10]);
-            % wait until the figure is closed
-            while(findobj('name','EV3 Sensor') == 1)
-                % get the reading
-                reading = brick.inputReadSI(layer,no,mode);
-                t = [t toc];
-                x = [x reading];
-                set(hplot,'Xdata',t)
-                set(hplot,'Ydata',x)
-                drawnow
-                % reset after 10 seconds
-                if (toc > 10)
-                   % reset
-                   t = 0;
-                   x = x(end);
-                   tic
-                end
-            end
-        end
-            
-        function displayColor(brick,layer,no)
-            % Brick.displayColor display sensor color 
-            %
-            % Brick.displayColor(layer,no) displays the color read from the
-            % color sensor in a MATLAB figure.
-            %
-            % Notes::
-            % - layer is the usb chain layer (usually 0).
-            % - NO is the output port number from [0..3] or sensor port
-            % number minus 1.
-            %
-            % Example::
-            %           b.displayColor(0,SensorPort.Sensor1)
-            
-            % create figure
-            hfig = figure('name','EV3 Color Sensor');
-            % wait until the figure is closed
-            while(findobj('name','EV3 Color Sensor') == 1)
-                % read the color sensor in color detection mode
-                color = brick.inputReadSI(layer,no,Device.ColColor);
-                % change the figure background according to the color
-                switch color
-                    case Device.NoColor
-                        set(hfig,'Color',[0.8,0.8,0.8])
-                    case Device.BlackColor
-                        set(hfig,'Color',[0,0,0])
-                    case Device.BlueColor
-                        set(hfig,'Color',[0,0,1])
-                    case Device.GreenColor
-                        set(hfig,'Color',[0,1,0])
-                    case Device.YellowColor
-                        set(hfig,'Color',[1,1,0])
-                    case Device.RedColor
-                        set(hfig,'Color',[1,0,0])
-                    case Device.WhiteColor
-                        set(hfig,'Color',[1,1,1])
-                    case Device.BrownColor
-                        set(hfig,'Color',[0.6,0.3,0])
-                    otherwise
-                        set(hfig,'Color',[0.8,0.8,0.8])
-                end
-                drawnow
-            end
+%             if brick.debug > 0
+%                  fprintf('Sensor reading: %.02f\n', reading);
+%             end
         end
         
         function outputStop(brick,layer,nos,brake)
@@ -1212,25 +873,6 @@ classdef CommunicationInterface < handle
             brick.send(cmd);
         end
         
-        function outputStopAll(brick)
-            % Brick.outputStopAll Stops all motors
-            %
-            % Brick.outputStopAll(layer) stops all motors on layer 0.
-            %
-            % Notes::
-            % - layer is the usb chain layer (usually 0).
-            % - Sends 0x0F as the NOS bit field to stop all motors.
-            %
-            % Example::
-            %           b.outputStopAll(0)
-            
-            cmd = Command();
-            cmd.addHeaderDirect(42,0,0);
-            cmd.opOUTPUT_STOP(0,15,BrakeMode.Brake);
-            cmd.addLength();
-            brick.send(cmd);
-        end
-        
         function outputPower(brick,layer,nos,power)
             % Brick.outputPower Set the motor output power
             % 
@@ -1313,7 +955,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive();
+            reply = brick.receive()';
+            msg = reply.msg;
             % motor state is the final byte
             state = msg(end);
         end
@@ -1338,7 +981,7 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive reply
-            brick.receive();
+            brick.waitForReply();
         end
         
         % Implemented @ MMI
@@ -1609,11 +1252,12 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             tacho = typecast(uint8(msg(6:9)),'int32');
-            if brick.debug > 0
-                fprintf('Tacho: %d degrees\n', tacho);
-            end
+%             if brick.debug > 0
+%                 fprintf('Tacho: %d degrees\n', tacho);
+%             end
         end
         
         % Implemented @ MMI 
@@ -1645,7 +1289,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % Current thoughts: the bug could be in the firmware (DUNDUNDUN).
             % The docu states: "Offset in the response buffer (global variables) must be
             % aligned (float/32bits first and 8 bits last)." [/lms2012/doc/html/directcommands.html]
@@ -1665,10 +1310,10 @@ classdef CommunicationInterface < handle
             catch
                 speed = 0;  % Sometimes, the response packet lacks the 10th byte...?!
             end
-            if brick.debug > 0
-                fprintf('Speed: %d\n', speed);
-                fprintf('buggy Tacho: %d degrees\n', tacho);
-            end
+%             if brick.debug > 0
+%                 fprintf('Speed: %d\n', speed);
+%                 fprintf('buggy Tacho: %d degrees\n', tacho);
+%             end
         end
         
         % Implemented @ MMI
@@ -1693,7 +1338,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the state
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the state
             state = msg(end);
         end
@@ -1719,7 +1365,7 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive reply
-            brick.receive();
+            brick.waitForReply();
         end
         
         function name = comGetBrickName(brick)
@@ -1736,7 +1382,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the brick name
             name = sscanf(char(msg(6:end)),'%s');
         end
@@ -1770,7 +1417,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the brick name
             mac = sscanf(char(msg(4:10)),'%s');
         end
@@ -1789,7 +1437,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the command
-            msg = brick.receive()';
+            reply = brick.receive()';
+            msg = reply.msg;
             % return the brick name
             id = sscanf(char(msg(6:end)),'%s');
         end
@@ -1845,7 +1494,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the sent response
-            rmsg = brick.receive();
+            reply = brick.receive()';
+            rmsg = reply.msg;
             handle = rmsg(end);
             pause(1)
             % send the file
@@ -1855,7 +1505,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the sent response
-            rmsg = brick.receive();
+            reply = brick.receive()';
+            rmsg = reply.msg;
             % print message 
             fprintf('%s uploaded\n',filename);
         end
@@ -1883,7 +1534,8 @@ classdef CommunicationInterface < handle
             cmd.addLength();
             brick.send(cmd);
             % receive the sent response
-            rmsg = brick.receive();
+            reply = brick.receive()';
+            rmsg = reply.msg;
             % extract payload
             payload = rmsg(13:end);
             % print to file
@@ -1915,7 +1567,8 @@ classdef CommunicationInterface < handle
             cmd.LIST_FILES(maxlength,pathname);
             cmd.addLength();
             brick.send(cmd);
-            rmsg = brick.receive();
+            reply = brick.receive()';
+            rmsg = reply.msg;
             % print
             fprintf('%s',rmsg(13:end));
         end    
@@ -1937,7 +1590,7 @@ classdef CommunicationInterface < handle
             cmd.CREATE_DIR(pathname);
             cmd.addLength();
             brick.send(cmd);
-            rmsg = brick.receive();
+            brick.waitForReply();
         end
         
         function deleteFile(brick,pathname)
@@ -1958,7 +1611,7 @@ classdef CommunicationInterface < handle
             cmd.DELETE_FILE(pathname);
             cmd.addLength();
             brick.send(cmd);
-            rmsg = brick.receive();
+            brick.waitForReply();
         end
         
         function writeMailBox(brick,title,type,msg)
@@ -1998,7 +1651,8 @@ classdef CommunicationInterface < handle
             % Example::
             %           [title,msg] = b.readMailBox('text')
             
-            mailmsg = brick.receive();
+            reply = brick.receive()';
+            mailmsg = reply.msg;
             % extract message title (starts at pos 8, pos 7 is the size)
             title = char(mailmsg(8:7+mailmsg(7)));
             % parse message according to type
@@ -2015,6 +1669,7 @@ classdef CommunicationInterface < handle
             end
         end
             
+        %% Bytecode test
         function threeToneByteCode(brick,filename)
             % Brick.threeToneByteCode Create three tone byte code
             %
@@ -2046,5 +1701,222 @@ classdef CommunicationInterface < handle
             % generate the byte code
             cmd.GenerateByteCode(filename);
         end
+        
+        %% Utility
+        % Methods in this block are composed of multiple commands and more logic for convenience
+        function drawTest(brick)
+            % Brick.drawTest Draw test shapes
+            %
+            % Brick.drawTest() shows the drawing capabilities of the brick.
+            %
+            % Example::
+            %           b.drawTest()
+            
+            cmd = Command();
+            cmd.addHeaderDirect(42,4,1);
+            % save the UI screen
+            cmd.opUI_DRAW_STORE(0);
+            % change the led pattern
+            cmd.opUI_WRITE_LED(Device.LedGreenFlash);
+            % clear the screen (top line still remains with remote cmds)
+            cmd.opUI_DRAW_FILLWINDOW(0,0,0);
+            % draw four pixels
+            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,12,15);
+            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,12,20);
+            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,18,15);
+            cmd.opUI_DRAW_PIXEL(vmCodes.vmFGColor,18,20);
+            % draw line
+            cmd.opUI_DRAW_LINE(vmCodes.vmFGColor,0,25,vmCodes.vmLCDWidth,25);
+            cmd.opUI_DRAW_LINE(vmCodes.vmFGColor,15,25,15,127);
+            % draw circle
+            cmd.opUI_DRAW_CIRCLE(1,40,40,10);
+            % draw rectangle
+            cmd.opUI_DRAW_RECT(vmCodes.vmFGColor,70,30,20,20);
+            % draw filled cricle
+            cmd.opUI_DRAW_FILLCIRCLE(vmCodes.vmFGColor,40,70,10);
+            % draw filled rectangle
+            cmd.opUI_DRAW_FILLRECT(vmCodes.vmFGColor,70,60,20,20);
+            % draw inverse rectangle
+            cmd.opUI_DRAW_INVERSERECT(30,90,60,20);
+            % change font
+            cmd.opUI_DRAW_SELECT_FONT(2);
+            % draw text
+            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,40,'EV3');
+            % change font
+            cmd.opUI_DRAW_SELECT_FONT(1);
+            % reprint
+            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,70,'EV3');
+            % change font
+            cmd.opUI_DRAW_SELECT_FONT(0);
+            % reprint
+            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,90,'EV3');
+            % voltage string
+            cmd.opUI_DRAW_TEXT(vmCodes.vmFGColor,100,110,'v =');
+            % store voltage
+            cmd.opUI_READ_GET_VBATT(0);
+            % print the voltage value (global)
+            cmd.opUI_DRAW_VALUE(vmCodes.vmFGColor,130,110,0,5,3);
+            % update the window
+            cmd.opUI_DRAW_UPDATE;
+            % 5 second timer (so you can see the changing LED pattern)
+            cmd.opTIMER_WAIT(5000,0);
+            % wait for timer
+            cmd.opTIMER_READY(0);
+            % reset the LED
+            cmd.opUI_WRITE_LED(Device.LedGreen);
+            % return UI screen
+            cmd.opUI_DRAW_RESTORE(0);
+            % return
+            cmd.opUI_DRAW_UPDATE;
+            cmd.addLength();
+            brick.send(cmd)
+        end
+        
+        function beep(brick,volume,duration)
+            % Brick.beep Play a beep on the brick
+            %
+            % Brick.beep(volume,duration) plays a beep tone with volume and
+            % duration.
+            %
+            % Notes::
+            % - volume is the beep volume from 0 to 100, by default 10. (DATA8)
+            % - duration is the beep duration in ms, by default 100. (DATA16)
+            %
+            % Example:: 
+            %           b.beep(5,500)
+            
+            if nargin < 2
+                volume = 10;
+            end
+            if nargin < 3
+                duration = 100;
+            end
+            brick.soundPlayTone(volume, 1000, duration);
+        end
+    end
+    
+    methods (Access = private)
+        function send(brick, cmd)
+            % Brick.send Send data to the brick
+            %
+            % Brick.send(cmd) sends a command to the brick through the
+            % connection handle.
+            %
+            % Notes::
+            % - cmd is a command object.
+            %
+            % Example::
+            %           b.send(cmd)
+            
+            % Send the message through the brickIO write function
+            brick.conn.write(cmd.msg);
+            
+            % (MMI) When spamming the brick with commands, at some point, it will start
+            % behaving 'strange'. Sometimes, commands will be executed only with 
+            % a delay, some commands may even be bypassed. 
+            % (Maybe too many commands screw up the brick's internal command queue?..)
+            % Temporary workaround: Wait 5ms after each sent packet. 
+            pause(0.005);
+            
+            % Verbose output
+            if brick.debug > 0
+               fprintf('\t(DEBUG) sent:  [ ');
+               for ii=1:length(cmd.msg)
+                   fprintf('%s ',dec2hex(cmd.msg(ii)))
+               end
+               fprintf(']\n');
+%                fprintf('\t             (dec):    [ ');
+%                for ii=1:length(cmd.msg)
+%                    fprintf('%d ',cmd.msg(ii))
+%                end
+%                fprintf(']\n\n');
+            end
+        end
+       
+        function reply = receive(brick)
+            % Brick.receive Receive data from the brick
+            %
+            % rmsg = Brick.receive() receives data from the brick through
+            % the connection handle.
+            %
+            % Notes::
+            %  - If received packet is corrupt, up to five new packets are read (if all are 
+            %    corrupt, an error is thrown) 
+            %
+            % Example::
+            %           rmsg = b.receive()
+            %
+
+            % Read the message through the brickIO read function
+            rmsg = brick.conn.read();
+            
+            % Check if reply is corrupt or error byte is set
+            try
+                reply = Command(rmsg);
+            catch ME
+                corrupt = 1;
+                if ~isempty(strfind(ME.identifier, 'CorruptPacket'))
+                    % Read packet was corrupt - retry
+                    %id = [ID(), ':', 'CorruptPacket'];
+                    %warning(id, 'Read corrupt packet. Retrying...');
+                    if brick.debug
+                        fprintf('received (corrupt) (hex):    [ ');
+                        for ii=1:length(rmsg)
+                            fprintf('%s ',dec2hex(rmsg(ii)))
+                        end
+                        fprintf(']\n');
+                        fprintf('received (corrupt) (dec):    [ ');
+                        for ii=1:length(rmsg)
+                            fprintf('%d ',rmsg(ii))
+                        end
+                        fprintf(']\n');
+                    end
+                    
+                    retries = 5;
+                    while corrupt && retries
+                        rmsg = brick.conn.read();
+                        try
+                            reply = Command(rmsg);
+                            corrupt = 0;
+                        catch
+                            retries = retries-1;
+                        end
+                    end
+                end
+                
+                if corrupt
+                    rethrow(ME);
+                end
+            end
+            
+            if reply.checkForError()
+                msg = 'Error byte is set. The Brick couldn''t handle the last packet';
+                id = [ID(), ':', 'CommandError'];
+                warning(id, msg);
+            end
+            
+            % Verbose output
+            if brick.debug > 0
+               fprintf('\t(DEBUG) received:  [ ');
+               for ii=1:length(rmsg)
+                   fprintf('%s ',dec2hex(rmsg(ii)))
+               end
+               fprintf(']\n');
+%                fprintf('\t                (dec):    [ ');
+%                for ii=1:length(rmsg)
+%                    fprintf('%d ',rmsg(ii))
+%                end
+%                fprintf(']\n\n');
+            end      
+        end
+        
+        function waitForReply(brick)
+            oldTimeOut = brick.timeOut;
+            brick.timeOut = 0;
+            
+            brick.receive();
+            
+            brick.timeOut = oldTimeOut;
+        end
     end
 end
diff --git a/source/Device.m b/source/Device.m
deleted file mode 100644
index ba1b61c9d75eef20d543fd42a46fa1be1cc27c47..0000000000000000000000000000000000000000
--- a/source/Device.m
+++ /dev/null
@@ -1,121 +0,0 @@
-%Device Device enumeration for the brick
-%
-% Notes::
-% - Collection of enumeration constants used for the brick
-
-classdef Device < uint8
-    enumeration
-         % motor types and modes
-         LargeMotor (7)
-         MediumMotor (8)
-         MotorDegrees (0)
-         MotorRotation (1)
-         MotorSpeed (2)
-         % motor definitions for setting and starting the motor (found in c_output.c => NOS DATA8)
-         MotorA (1)
-         MotorB (2)
-         MotorC (4)
-         MotorD (8)
-         % motor definitions for reading motor data with output functions (found in c_output.c)
-         %  e.g. outputGetCount(...), outputRead(...) (the latter is yet to be implemented)
-         MotorA_PORT (0)
-         MotorB_PORT (1)
-         MotorC_PORT (2)
-         MotorD_PORT (3)
-         % motor definitions for input functions (found in (?))
-         %  e.g. inputDeviceGetConnection(...), inputDeviceGetName(...), ...
-         MotorA_INPUT (16)
-         MotorB_INPUT (17)
-         MotorC_INPUT (18)
-         MotorD_INPUT (19)
-         % mode of braking (found in c_output.c)
-         Coast (0)
-         Brake (1)
-         % sensor ports (found in c_output.c)
-         Port1 (0)
-         Port2 (1)
-         Port3 (2)
-         Port4 (3)
-         % LED patterns (found in bytecodes.h)
-         LedBlack (0)
-         LedGreen (1)
-         LedRed   (2)
-         LedOrange (3)
-         LedGreenFlash (4)
-         LedRedFlash (5)
-         LedOrangeFlash (6)
-         LedGreenPulse (7)
-         LedRedPulse (8)
-         LedOrangePulse (9)
-         % colors (found in bytecodes.h)
-         NoColor (0)
-         BlackColor (1)
-         BlueColor (2)
-         GreenColor (3)
-         YellowColor (4)
-         RedColor (5)
-         WhiteColor (6)
-         BrownColor (7)
-         % ultrasonic sensor definitions (found in types.html)
-         Ultrasonic (30)
-         USDistCM (0)
-         USDistIN (1)
-         USListen (2)
-         % gyro sensor definitions (found in types.html)
-         Gyro (32)
-         GyroAng (0)
-         GyroRate (1)
-         % touch sensor definitions (found in types.html)
-         Touch (16)
-         Pushed (0)
-         Bumps (1)
-         % color sensor definitions (found in types.html)
-         Color (29)
-         ColReflect (0)
-         ColAmbient (1)
-         ColColor (2)
-         % input & output connection types (found in lms2012.h)
-         ConnUnknown (111)
-         ConnDaisyChain (117)
-         ConnNXTColor (118)
-         ConnNXTDumb (119)
-         ConnNXTIIC (120)
-         ConnInputDumb (121)
-         ConnInputUART (122)
-         ConnOutputDumb (123)
-         ConnOutputIntelligent (124)
-         ConnOutputTacho (125)
-         ConnNone (126)
-         ConnError (127)
-         % NXT sound sensor definitions (found in types.html)
-         Sound (3)
-         SoundDB (0)
-         SoundDBA (1)
-         % NXT light sensor definitions (found in types.html)
-         NXTLight (2)
-         NXTReflect (0)
-         NXTAmbient (1)
-         % NXT touch sensor definitions
-         NXTTouch (1)
-         % NXT color sensor definitions
-         NXTColor (4)
-         NXTColReflect (0)
-         NXTColAmbient (1)
-         NXTColCol (2)
-         NXTColGreen (3)
-         NXTColBlue (4)
-         NXTColRaw (5)
-         % NXT ultrasonic sensor definitions
-         NXTUltrasonic (5)
-         NXTUSDistCM (0)
-         NXTUSDistIN (1)
-         % NXT temperature sensor definitions
-         NXTTemperature (6)
-         NXTTempC (0)
-         NXTTempF (1)
-         % additional device types
-         TypeUnknown (125)
-         TypeNone (126)
-         TypeError (127)
-    end
-end
diff --git a/source/EV3.m b/source/EV3.m
old mode 100755
new mode 100644
index 29aeda84acbb2c7d4f03abd06626ad0690fd095f..d6e62bc1b550376d624c0e329b5dd29f3d3a86d9
--- a/source/EV3.m
+++ b/source/EV3.m
@@ -4,183 +4,188 @@ classdef EV3 < MaskedHandle
     % This is the 'central' class (from user's view) when working with this toolbox. It
     % delivers a convenient interface for creating a connection to the brick and sending
     % commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for each port.
-    % 
+    %
+    %
     % Notes:
     %     * Creating multiple EV3 objects and connecting them to different physical bricks has not
     %       been thoroughly tested yet, but seems to work on a first glance.
+    %     * When an input argument of a method is marked as optional, the argument needs to be
+    %       'announced' by a preceding 2nd argument, which is a string containing the name of the argument.
+    %       For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+    %       follows: *brickObject.motorA.setProperties('power', 50);*
+    %
     %
     %
     % Attributes:
-    %     motorA (Motor): Motor-object interfacing port A
-    %     motorB (Motor): Motor-object interfacing port B
-    %     motorC (Motor): Motor-object interfacing port C
-    %     motorD (Motor): Motor-object interfacing port D
-    %     sensor1 (Sensor): Motor-object interfacing port 1
-    %     sensor2 (Sensor): Motor-object interfacing port 2
-    %     sensor3 (Sensor): Motor-object interfacing port 3
-    %     sensor4 (Sensor): Motor-object interfacing port 4
+    %     motorA (Motor): Motor-object interfacing port A. See also :class:`Motor`.
+    %     motorB (Motor): Motor-object interfacing port B. See also :class:`Motor`.
+    %     motorC (Motor): Motor-object interfacing port C. See also :class:`Motor`.
+    %     motorD (Motor): Motor-object interfacing port D. See also :class:`Motor`.
+    %     sensor1 (Sensor): Motor-object interfacing port 1. See also :class:`Sensor`.
+    %     sensor2 (Sensor): Motor-object interfacing port 2. See also :class:`Sensor`.
+    %     sensor3 (Sensor): Motor-object interfacing port 3. See also :class:`Sensor`.
+    %     sensor4 (Sensor): Motor-object interfacing port 4. See also :class:`Sensor`.
     %     debug (numeric in {0,1,2}): Debug mode. *[WRITABLE]*
     %
     %         - 0: Debug turned off
     %         - 1: Debug turned on for EV3-object -> enables feedback in the console about what firmware-commands have been called when using a method
     %         - 2: Low-level-Debug turned on -> each packet sent and received is printed to the console
     %
-    %     batteryMode (string in {'Percentage', 'Voltage'}): Mode for reading battery charge.
-    %         *[WRITABLE]*
-    %     batteryValue (numeric): Current battery charge. Depending on batteryMode, the reading
-    %         is either in percentage or voltage. *[READ-ONLY]*
+    %     batteryMode (string in {'Percentage', 'Voltage'}): Mode for reading battery charge. See also :attr:`batteryValue`. *[WRITABLE]*
+    %     batteryValue (numeric): Current battery charge. Depending on batteryMode, the reading is either in percentage or voltage. See also :attr:`batteryMode`. *[READ-ONLY]*
     %     isConnected (bool): True if virtual brick-object is connected to physical one. *[READ-ONLY]*
     %
     %
-    % Examples:
-    %     b = EV3(); |br| 
-    %     b.connect('usb'); |br|   
-    %     ma = b.motorA; |br|
-    %     ma.setProperties('power', 50, 'limitValue', 720); |br|
-    %     ma.start(); |br|  
+    % Example:
+    %     % This example expects a motor at port A and a (random) sensor at port 1 |br|
+    %     b = EV3(); % |br|
+    %     b.connect('usb'); % |br|
+    %     ma = b.motorA; % |br|
+    %     ma.setProperties('power', 50, 'limitValue', 720); % |br|
+    %     ma.start(); % |br|
     %     % fun |br|
-    %     b.sensor1.value |br|
-    %     b.waitFor(); |br|
-    %     b.beep(); |br|
-    %     delete b; |br|
-    
+    %     ma.waitFor(); % |br|
+    %     disp(b.sensor1.value); % |br|
+    %     b.beep(); % |br|
+    %     delete b; % |br|
+
     properties
         % batteryMode (string in {'Percentage', 'Voltage'}): Mode for reading battery charge. [WRITABLE]
         % See also BATTERYVALUE
         batteryMode;
-        
+
         % debug (numeric in {0,1,2}): Debug mode. [WRITABLE]
         %     - 0: Debug turned off
-        %     - 1: (High-level-) Debug turned on for EV3-object - enables feedback in the 
+        %     - 1: (High-level-) Debug turned on for EV3-object - enables feedback in the
         %          console about what firmware-commands have been called when using a method
         %     - 2: Low-level-Debug turned on - each packet sent and received is printed to the
         %          console
-        debug; 
+        debug;
     end
 
     properties (Dependent)  % Parameters to be read directly from physical brick
         % batteryValue (numeric): Current battery charge. Depending on batteryMode, the reading
         %     is either in percentage or voltage. [READ-ONLY]
         % See also BATTERYMODE
-        batteryValue; 
+        batteryValue;
     end
-    
+
     properties (SetAccess = private)  % Read-only properties that are set internally
         % isConnected (bool): True if virtual brick-object is connected to physical one. [READ-ONLY]
-        % See also EV3.CONNECT, EV3.DISCONNECT
-        isConnected = false; 
-        
-        % motorA (Motor): Motor-object interfacing port A
+        isConnected = false;
+
+        % motorA (Motor): Motor-object interfacing port A.
         % See also MOTOR
         motorA;
-        % motorB (Motor): Motor-object interfacing port B
+        % motorB (Motor): Motor-object interfacing port B.
         % See also MOTOR
         motorB;
-        % motorC (Motor): Motor-object interfacing port C
+        % motorC (Motor): Motor-object interfacing port C.
         % See also MOTOR
         motorC;
-        % motorD (Motor): Motor-object interfacing port D
+        % motorD (Motor): Motor-object interfacing port D.
         % See also MOTOR
         motorD;
-        
-        % sensor1 (Sensor): Sensor-object interfacing port 1
+
+        % sensor1 (Sensor): Sensor-object interfacing port 1.
         % See also SENSOR
         sensor1;
-        % sensor2 (Sensor): Sensor-object interfacing port 2
+        % sensor2 (Sensor): Sensor-object interfacing port 2.
         % See also SENSOR
         sensor2;
-        % sensor3 (Sensor): Sensor-object interfacing port 3
+        % sensor3 (Sensor): Sensor-object interfacing port 3.
         % See also SENSOR
         sensor3;
-        % sensor4 (Sensor): Sensor-object interfacing port 4
+        % sensor4 (Sensor): Sensor-object interfacing port 4.
         % See also SENSOR
-        sensor4;            
+        sensor4;
     end
-    
+
     properties (Access = private)
         % commInterface (CommunicationInterface): Interface to communication layer
         %     All commands sent to the Brick are created and written through this object. Each
         %     Motor- and Sensor-object has a reference to it.
         commInterface = 0;
     end
-    
+
     properties (Hidden, Access = private)  % Hidden properties for internal use only
         % init (bool): Indicates init-phase (i.e. constructor is running).
         init = true;
     end
-    
+
     methods  % Standard methods
         %% Constructor
         function ev3 = EV3(varargin)
             % Sets properties of EV3-object and creates Motor- and Sensor-objects with default
             % parameters.
             %
-            % Arguments
-            %     varargin: see setProperties(ev3, varargin)
+            % Arguments:
+            %     varargin: see setProperties(ev3, varargin).
             %
-            % See also SETPROPERTIES
-            
+            % See also SETPROPERTIES / :meth:`setProperties(ev3, varargin)`
+
             ev3.setProperties(varargin{:});
-            
-            ev3.motorA = Motor('A', 'Debug', ev3.debug>=1);
-            ev3.motorB = Motor('B', 'Debug', ev3.debug>=1);
-            ev3.motorC = Motor('C', 'Debug', ev3.debug>=1);
-            ev3.motorD = Motor('D', 'Debug', ev3.debug>=1);
-            
-            
-            ev3.sensor1 = Sensor('1', 'Debug', ev3.debug>=1);
-            ev3.sensor2 = Sensor('2', 'Debug', ev3.debug>=1);
-            ev3.sensor3 = Sensor('3', 'Debug', ev3.debug>=1);
-            ev3.sensor4 = Sensor('4', 'Debug', ev3.debug>=1);
-            
+
+            ev3.motorA = Motor('A', ev3, 'Debug', ev3.debug>0);
+            ev3.motorB = Motor('B', ev3, 'Debug', ev3.debug>0);
+            ev3.motorC = Motor('C', ev3, 'Debug', ev3.debug>0);
+            ev3.motorD = Motor('D', ev3, 'Debug', ev3.debug>0);
+
+
+            ev3.sensor1 = Sensor('1', ev3, 'Debug', ev3.debug>0);
+            ev3.sensor2 = Sensor('2', ev3, 'Debug', ev3.debug>0);
+            ev3.sensor3 = Sensor('3', ev3, 'Debug', ev3.debug>0);
+            ev3.sensor4 = Sensor('4', ev3, 'Debug', ev3.debug>0);
+
             ev3.init = false;
         end
-        
+
         function delete(ev3)
-            % Disconnects from physical brick and deletes this instance
-            
+            % Disconnects from physical brick and deletes this instance.
+
             if ev3.isConnected
                 ev3.disconnect();
             end
         end
-        
-        %% Connection 
+
+        %% Connection
         function connect(ev3, varargin)
             % Connects EV3-object and its Motors and Sensors to physical brick.
             %
             % Arguments:
             %     connectionType (string in {'bt', 'usb'}): Connection type
-            %     serPort (string in {'/dev/rfcomm1', '/dev/rfcomm2', ...}): Path to serial port 
-            %         (if 'bt')
-            %     beep (bool): If true, EV3 beeps if connection has been established
+            %     serPort (string in {'/dev/rfcomm1', '/dev/rfcomm2', ...}): Path to serial port
+            %         (necessary if connectionType is 'bt'). *[OPTIONAL]*
+            %     beep (bool): If true, EV3 beeps if connection has been established. *[OPTIONAL]*
             %
-            % Examples:
+            % Example:
             %     % Setup bluetooth connection via com-port 0 |br|
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     % Setup usb connection, beep when connection has been established
-            %     b = EV3(); |br|
-            %     b.connect('usb', 'beep', 'on', ); |br| 
-            %     
-            
-            % Check connection
+            %     b = EV3(); % |br|
+            %     b.connect('usb', 'beep', 'on', ); % |br|
+            %
+            % See also ISCONNECTED / :attr:`isConnected`
+
             if ev3.isConnected
                 if isCommInterfaceValid(ev3.commInterface)
-                    error('EV3::connect: Already connected.');
+                    warning('EV3::connect: Already connected. Resetting connection now...');
+                    ev3.disconnect();
                 else
                     warning(['EV3::connect: EV3.isConnected is set to ''True'', but ',...
                              'comm handle is invalid. Deleting invalid handle and ' ,...
                              'resetting EV3.isConnected now...']);
-                         
+
                     ev3.commInterface = 0;
                     ev3.isConnected = false;
                 end
             end
-            
+
             if nargin < 2
                  error('EV3::connect: Wrong number of input arguments.');
             end
-            
+
             idxes = strcmpi('beep', varargin);
             idx = find([0, idxes(1:end-1)]);
             if ~isempty(idx)
@@ -191,29 +196,18 @@ classdef EV3 < MaskedHandle
             else
                 beep = false;
             end
-            
+
             % Try to connect
-            try 
+            try
                 % Connect to physical brick
                 % -> Creating communication-handle implicitly establishes connection
                 ev3.commInterface = CommunicationInterface(varargin{:}, 'debug', ev3.debug>=2);
                 ev3.isConnected = true;
-                
+
                 if beep
                     ev3.beep();
                 end
                 
-                % Connect motors
-                ev3.motorA.connect(ev3.commInterface);
-                ev3.motorB.connect(ev3.commInterface);
-                ev3.motorC.connect(ev3.commInterface);
-                ev3.motorD.connect(ev3.commInterface);
-                
-                % Connect sensors
-                ev3.sensor1.connect(ev3.commInterface);
-                ev3.sensor2.connect(ev3.commInterface);
-                ev3.sensor3.connect(ev3.commInterface);
-                ev3.sensor4.connect(ev3.commInterface);
             catch ME
                 % Something went wrong...
                 ev3.isConnected = false;
@@ -221,11 +215,11 @@ classdef EV3 < MaskedHandle
                     ev3.commInterface.delete();
                     ev3.commInterface = 0;
                 end
-                
+
                 rethrow(ME);
             end
         end
-        
+
         function disconnect(ev3)
             % Disconnects EV3-object and its Motors and Sensors from physical brick.
             %
@@ -233,177 +227,144 @@ classdef EV3 < MaskedHandle
             %     * Gets called automatically when EV3-object is destroyed.
             %
             % Example:
-            %     b = EV3(); 
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0');
-            %     % do stuff
-            %     b.disconnect();
-            
-            % Reset motors and sensors before disconnecting
-            ev3.resetPhysicalBrick();
-            
-            % Disconnect motors and sensors
-            % -> set references to comm handle to 0
-            ev3.motorA.disconnect();
-            ev3.motorB.disconnect();
-            ev3.motorC.disconnect();
-            ev3.motorD.disconnect();
-            
-            ev3.sensor1.disconnect();
-            ev3.sensor2.disconnect();
-            ev3.sensor3.disconnect();
-            ev3.sensor4.disconnect();
-            
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
+            %     % do stuff |br|
+            %     b.disconnect(); % |br|
+            
+            % Resetting needs a working connection in order to send reset-commands
+            % to the Brick. If the connection has been aborted (e.g. by pulling the
+            % USB-cord), the reset-methods would fail -> catch this error and for
+            % now do nothing.
+            try
+                ev3.resetPhysicalBrick();
+            catch ME
+                % For now: ignore
+            end
+
             % Delete handle to comm-interface
             if isCommInterfaceValid(ev3.commInterface) && ev3.commInterface ~= 0
                 ev3.commInterface.delete();
             end
             ev3.commInterface = 0;
-            
+
             ev3.isConnected = false;
         end
-        
+
         %% Device functions
-        function stopAllMotors(ev3)
-            % Sends a stop-command to all motor-ports
-            
-            if ~ev3.isConnected
-                stopAllMotors(['EV3::beep: Brick-Object not connected physical brick. ',...
-                       'You have to call ev3.connect(...) first!']);
-            end
-            
-            ev3.commInterface.outputStopAll();
-        end
+%         function stopAllMotors(ev3)
+%             % Sends a stop-command to all motor-ports.
+%             ev3.handleCommand(@outputStop, 0, MotorBitfield.MotorA ...
+%                                              +MotorBitfield.MotorB ...
+%                                              +MotorBitfield.MotorC ...
+%                                              +MotorBitfield.MotorD, 0);
+%         end
         
+        function resetAllDeviceValues(ev3)
+            % Resets values of all sensors on all ports (including tacho counter on motors)
+            ev3.handleCommand(@inputDeviceClrAll, 0);
+        end
+
         %% Sound functions
         function beep(ev3)
             % Plays a 'beep'-tone on brick.
             %
             % Notes:
-            %     * This equals playTone(10, 1000, 100) (Wraps the same opCode in comm-layer)
+            %     * This equals playTone(10, 1000, 100).
             %
             % Example:
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
-            %     b.beep(); |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
+            %     b.beep(); % |br|
             %
-            
-            if ~ev3.isConnected
-                error(['EV3::beep: Brick-Object not connected physical brick. ',...
-                       'You have to call ev3.connect(...) first!']);
-            end
-            
-            ev3.commInterface.beep();
-            
-            if ev3.debug
-				fprintf('(DEBUG) EV3::beep: Called beep on brick\n');
-            end
+            ev3.handleCommand(@soundPlayTone, 10, 1000, 100);
         end
-        
+
         function playTone(ev3, volume, frequency, duration)
             % Plays tone on brick.
             %
             % Arguments:
             %     volume (numeric in [0, 100]): in percent
             %     frequency (numeric in [250, 10000]): in Hertz
-            %     duration (numeric >0): in milliseconds
+            %     duration (numeric > 0): in milliseconds
             %
             % Example:
-            %     b = EV3(); |br| 
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     b.playTone(40, 5000, 1000);  % Plays tone with 40% volume and 5000Hz for 1
             %     second. |br|
             %
-            
-            if ~ev3.isConnected
-                error(['EV3::isConnected: Brick-Object not connected physical brick. ',...
-                       'You have to call ev3.connect(...) first!']);
-            end
-            
-            ev3.commInterface.soundPlayTone(volume, frequency, duration);
-            
-            if ev3.debug
-				fprintf('(DEBUG) EV3::beep: Called soundPlayTone on brick\n');
-            end
+            ev3.handleCommand(@soundPlayTone, volume, frequency, duration);
         end
-        
+
         function stopTone(ev3)
-            % Stops tone currently played
+            % Stops tone currently played.
             %
             % Example:
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     b.playTone(10,100,100000000);  % Accidentally given wrong tone duration :) |br|
             %     b.stopTone();  % Stops tone immediately. |br|
             %
-            
-            if ~ev3.isConnected
-                error(['EV3::stopTone: Brick-Object not connected physical brick. ',...
-                       'You have to call ev3.connect(...) first!']);
-            end
-            
-            ev3.commInterface.soundStopTone();
-            
-            if ev3.debug
-				fprintf('(DEBUG) EV3::beep: Called soundStopTone on brick\n');
-            end
+            ev3.handleCommand(@soundStopTone);
         end
-        
+
         function status = tonePlayed(ev3)
             % Tests if tone is currently played.
             %
-            % Returns:  
+            % Returns:
             %     status (bool): True if a tone is being played
-            %            
+            %
             % Example
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
-            %     b.playTone(10, 100, 1000); |br|
-            %     pause(0.5); |br|
-            %     b.tonePlayed() -> Outputs 1 to console. |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
+            %     b.playTone(10, 100, 1000); % |br|
+            %     pause(0.5); % Small pause is necessary as tone does not start instantaneously |br|
+            %     b.tonePlayed(); % -> Outputs 1 to console.  |br|
             %
-            
-            if ~ev3.isConnected
-                error(['EV3::tonePlayed: Brick-Object not connected physical brick. ',...
-                       'You have to call ev3.connect(...) first!']);
-            end
-            
-            status = ev3.commInterface.soundTest;
-            
-            if ev3.debug
-				fprintf('(DEBUG) EV3::beep: Called soundTest on brick\n');
-            end
+            status = ev3.handleCommand(@soundTest);
         end
-        
+
         %% Setter
         function set.commInterface(ev3, comm)
             if ~isCommInterfaceValid(comm)
                 error('EV3::set.commInterface: Handle to Brick-object not valid.');
-            else
-                ev3.commInterface = comm;
             end
+
+            ev3.commInterface = comm;
         end
-        
+
         function set.batteryMode(ev3, batteryMode)
             validModes = {'Voltage', 'Percentage'};
             if ~ischar(batteryMode) || ~ismember(batteryMode, validModes)
                 error('EV3::set.batteryMode: Given parameter is not a valid battery mode.');
-            else 
-                ev3.batteryMode = batteryMode;
             end
+
+            ev3.batteryMode = batteryMode;
         end
-        
+
         function set.debug(ev3, debug)
             if ~isBool(debug) && debug ~= 2
                 error('EV3::set.debug: Given parameter is not a bool.');
             end
-            
+
             ev3.debug = str2bool(debug);
-            
+
             if ev3.isConnected
-                ev3.commInterface.debug = (ev3.debug >= 2); 
+                ev3.commInterface.debug = (ev3.debug >= 2);
             end
+
+            ev3.motorA.debug = (ev3.debug > 0);
+            ev3.motorB.debug = (ev3.debug > 0);
+            ev3.motorC.debug = (ev3.debug > 0);
+            ev3.motorD.debug = (ev3.debug > 0);
+
+            ev3.sensor1.debug = (ev3.debug > 0);
+            ev3.sensor2.debug = (ev3.debug > 0);
+            ev3.sensor3.debug = (ev3.debug > 0);
+            ev3.sensor4.debug = (ev3.debug > 0);
         end
-        
+
         function setProperties(ev3, varargin)
             % Set multiple EV3 properties at once using MATLAB's inputParser.
             %
@@ -412,15 +373,15 @@ classdef EV3 < MaskedHandle
             %     batteryMode (string in {'Voltage'/'Percentage'}): see EV3.batteryMode *[OPTIONAL]*
             %
             % Example:
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
-            %     b.setProperties('debug', 'on', 'batteryMode', 'Voltage'); |br|
-            %     % Instead of: b.debug = 'on'; b.batteryMode = 'Voltage'; |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
+            %     b.setProperties('debug', 'on', 'batteryMode', 'Voltage'); % |br|
+            %     % Instead of: b.debug = 'on'; b.batteryMode = 'Voltage'; % |br|
             %
-            % See also EV3.DEBUG, EV3.BATTERYMODE
-            
+            % See also EV3.DEBUG, EV3.BATTERYMODE / :attr:`debug`, :attr:`batteryMode`
+
             p = inputParser();
-            
+
             % Set default values
             if ev3.init
                 defaultDebug = false;
@@ -429,86 +390,122 @@ classdef EV3 < MaskedHandle
                 defaultDebug = ev3.debug;
                 defaultBatteryMode = ev3.batteryMode;
             end
-            
+
             % Add parameter
             p.addOptional('debug', defaultDebug);
             p.addOptional('batteryMode', defaultBatteryMode);
-            
+
             % Parse...
             p.parse(varargin{:});
-            
+
             % Set properties
             ev3.batteryMode = p.Results.batteryMode;
             ev3.debug = p.Results.debug;
         end
-        
+
         %% Getter
         function bat = get.batteryValue(ev3)
             if ~ev3.isConnected
-                warning('EV3::getBattery: EV3-Object not connected to physical EV3.');
-                
+                warning(ID('noConnection'), 'EV3-Object not connected to physical EV3.');
+
                 bat = 0;
                 return;
             end
-            
+
             bat = ev3.getBattery();
         end
-        
+
         function display(ev3)
-            % Displays EV3-properties and its devices
-            
-            displayProperties(ev3); 
-            
+            % Displays EV3-properties and its devices.
+
+            displayProperties(ev3);
+
             fprintf('\n\tDevices\n');
             props = properties(ev3);
-            
+
             warning('off', 'all');  % Turn off warnings while reading values
             for i = 1:length(props)
                 p = props{i};
+                member = ev3.(p);
                 
-                if strcmp(class(ev3.(p)),'Sensor') || strcmp(class(ev3.(p)), 'Motor')
-                    fprintf('\t%15s [Type: %s]\n', p, char(ev3.(p).type));
+                if strcmp(class(member),'Sensor') || strcmp(class(member), 'Motor')
+                    fprintf('\t%15s [Type: %s]\n', p, char(member.type));
                 end
             end
             warning('on', 'all');
         end
     end
-    
+
     methods (Access = private)  % Private brick functions that are wrapped by dependent params
-        function bat = getBattery(ev3)
+        function varargout = handleCommand(ev3, command, varargin)
+            % Execute a CommunicationInterface-method given as a handle
+            %
+            % As those methods have different, fixed numbers of output arguments, this quantity
+            % has to be retrieved first.
+            
             if ~ev3.isConnected
-                error(['EV3::getBattery: EV3-Object not connected to physical EV3. You have ',...
-                    'to call ev3.connect(properties) first!']);
+                msg = ['Brick-Object not connected physical brick. ',...
+                       'You have to call connect(...) first!'];
+                id = [ID(), ':', 'NotConnected'];
+                
+                throw(MException(id, msg));
+            end            
+            
+            if ev3.debug
+                fprintf('(DEBUG) Sending %s\n', func2str(command));
             end
+
+            % Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
+            % do this ugly workaround using strings. See
+            % https://de.mathworks.com/matlabcentral/answers/96617-how-can-i-use-nargin-nargout-to-determine-the-number-of-input-output-arguments-of-an-object-method
+            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(command)));
+            [varargout{1:nOut}] = ev3.dispatch(command, nOut, varargin{:});
+        end
+        
+        function bat = getBattery(ev3)
+            % Retrieve batteryValue from brick in current mode. (Wrapped by get.batteryValue)
             
             if strcmpi(ev3.batteryMode, 'Percentage')
-                bat = ev3.commInterface.uiReadLbatt();
-                
-                if ev3.debug
-                    fprintf('(DEBUG) EV3::getBattery: Called uiReadLBatt.\n');
-                end
-            elseif strcmpi(ev3.batteryMode, 'Voltage')
-                bat = ev3.commInterface.uiReadVbatt();
-                
-                if ev3.debug
-                    fprintf('(DEBUG) EV3::getBattery: Called uiReadVBatt.\n');
-                end
+                bat = ev3.handleCommand(@uiReadLbatt);
+            else
+                bat = ev3.handleCommand(@uiReadVbatt);
             end
         end
-        
+
         function resetPhysicalBrick(ev3)
+            % Resets Motors and Sensors.
+            %
+            % Notes:
+            %     * Gets called automatically by EV3.disconnect.
+            %
+            % See also MOTOR.RESETPHYSICALMOTOR, SENSOR.RESETPHYSICALSENSOR
+
             sensors = {'sensor1', 'sensor2', 'sensor3', 'sensor4'};
             motors = {'motorA', 'motorB', 'motorC', 'motorD'};
-            
+
             for i = 1:4
                 motor = motors{i};
-                ev3.(motor).resetPhysicalMotor();
-            end
-            
-            for i = 1:4
                 sensor = sensors{i};
+                ev3.(motor).resetPhysicalMotor();
                 ev3.(sensor).resetPhysicalSensor();
             end
         end
     end
-end 
+    
+    methods (Access = {?Sensor, ?Motor})
+        function varargout = dispatch(ev3, command, noOutputArguments, varargin)
+            try
+                [varargout{1:noOutputArguments}] = command(ev3.commInterface, varargin{:});
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    warning('Lost connection to the Brick!');
+                    %ev3.disconnect();
+                else
+                    warning('Something went wrong. Try to reset the connection.');
+                end
+
+                throw(ME);
+            end
+        end
+    end
+end
diff --git a/source/ID.m b/source/ID.m
index b108a1c633f4cf667b31f2c46e37b18fcea9521b..e62f1abef8348f94ba6358d43e82e9e8bdcceb99 100755
--- a/source/ID.m
+++ b/source/ID.m
@@ -1,7 +1,13 @@
-function id = ID()
+function id = ID(varargin)
 % Generates a string that serves as an error-ID for a calling function
+% Optionally, a string can be given as argument. It will be appended to the ID.
 
+% Setup constants
 toolbox = 'RWTHMindstormsEV3';
+appendix = '';
+if nargin > 0 && ischar(varargin{1})
+    appendix = [':', varargin{1}];
+end
 
 % Get stack trace
 stackTrace = dbstack();
@@ -22,9 +28,9 @@ functionName = callerList{length(callerList)};
 % Create id
 if length(callerList) > 1
     className = callerList{length(callerList)-1};
-    id = [toolbox, ':', className, ':', functionName];
+    id = [toolbox, ':', className, ':', functionName, appendix];
 else
-    id = [toolbox, ':', functionName];
+    id = [toolbox, ':', functionName, appendix];
 end
 
 end
diff --git a/source/Motor.m b/source/Motor.m
old mode 100755
new mode 100644
index 27633f4d400364f9defde9cc389fc83d037f7013..e087e8375d57101b45ae5b4e179c9da52c8ca396
--- a/source/Motor.m
+++ b/source/Motor.m
@@ -1,4 +1,4 @@
-classdef Motor < MaskedHandle & dynamicprops
+classdef Motor < MaskedHandle & dynamicprops      
     % High-level class to work with motors.
     %
     % This class is supposed to ease the use of the brick's motors. It is possible to set all
@@ -11,29 +11,33 @@ classdef Motor < MaskedHandle & dynamicprops
     %     * The Motor-class represents motor ports, not individual motors!
     %     * If you start a motor with power=0, the internal state will still be set to
     %       'isRunning'
+    %     * When an input argument of a method is marked as optional, the argument needs to be 
+    %       'announced' by a preceding 2nd argument, which is a string containing the name of the argument. 
+    %       For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+    %       follows: *brickObject.motorA.setProperties('power', 50);*
     %
     % Attributes:
     %    power (numeric in [-100, 100]): Power level of motor in percent. *[WRITABLE]*
     %    speedRegulation (bool): Speed regulation turned on or off. When turned on, motor will 
     %        try to 'hold' its speed at given power level, whatever the load. In this mode, the
     %        highest possible speed depends on the load and mostly goes up to around 70-80 (at 
-    %        this point, the Brick internally input 100% power). When turned off, motor will 
+    %        this point, the Brick internally inputs 100% power). When turned off, motor will 
     %        constantly input the same power into the motor. The resulting speed will be 
     %        somewhat lower, depending on the load. *[WRITABLE]*
     %    smoothStart (numeric s. t. smoothStart+smoothStop < limitValue): Degrees/Time 
     %        indicating how far/long the motor should smoothly start. Depending on limitMode, 
     %        the input is interpreted either in degrees or milliseconds. The first 
     %        {smoothStart}-milliseconds/degrees of limitValue the motor will slowly accelerate 
-    %        until reaching its defined speed. *[WRITABLE]*
+    %        until reaching its defined speed. See also :attr:`limitValue`, :attr:`limitMode`. *[WRITABLE]*
     %    smoothStop (numeric s. t. smoothStart+smoothStop < limitValue): Degrees/Time 
     %        indicating how far/long the motor should smoothly stop. Depending on limitMode, the 
     %        input is interpreted either in degrees or milliseconds. The last 
     %        [smoothStop]-milliseconds/degrees of limitValue the motor will slowly slow down 
-    %        until it has stopped. *[WRITABLE]*
+    %        until it has stopped. See also :attr:`limitValue`, :attr:`limitMode`. *[WRITABLE]*
     %    limitValue (numeric>=0): Degrees/Time indicating how far/long the motor should run.
     %        Depending on limitMode, the input is interpreted either in degrees or 
-    %        milliseconds. *[WRITABLE]*
-    %    limitMode ('Tacho'|'Time'): Mode for motor limit. *[WRITABLE]*
+    %        milliseconds. See also :attr:`limitMode`. *[WRITABLE]*
+    %    limitMode ('Tacho'|'Time'): Mode for motor limit. See also :attr:`limitValue`. *[WRITABLE]*
     %    brakeMode ('Brake'|'Coast'): Action done when stopping. If 'Coast', the motor will (at 
     %        tacholimit, if ~=0) coast to a stop. If 'Brake', the motor will stop immediately 
     %        (at tacholimit, if ~=0) and hold the brake. *[WRITABLE]*
@@ -41,9 +45,9 @@ classdef Motor < MaskedHandle & dynamicprops
     %        the sublayer ('communication layer'), there is feedback in the console about what 
     %        command has been called. *[WRITABLE]*
     %    isRunning (bool): True if motor is running. *[READ-ONLY]*
-    %    tachoCount (numeric): Current tacho count. *[READ-ONLY]*
+    %    tachoCount (numeric): Current tacho count in degrees. *[READ-ONLY]*
     %    currentSpeed (numeric): Current speed of motor. If speedRegulation=on this should equal power, 
-    %        otherwise it will probably be lower than that. *[READ-ONLY]*
+    %        otherwise it will probably be lower than that. See also :attr:`speedRegulation`. *[READ-ONLY]*
     %    type (DeviceType): Type of connected device if any. *[READ-ONLY]*
     
     
@@ -54,7 +58,7 @@ classdef Motor < MaskedHandle & dynamicprops
         % speedRegulation (bool): Speed regulation turned on or off. [WRITABLE]
         %     When turned on, motor will try to 'hold' its speed at given power level, whatever
         %     the load. In this mode, the highest possible speed depends on the load and mostly 
-        %     goes up to around 70-80 (at this point, the Brick internally input 100% power). 
+        %     goes up to around 70-80 (at this point, the Brick internally inputs 100% power). 
         %     When turned off, motor will constantly input the same power into the motor. The 
         %     resulting speed will be somewhat lower, depending on the load. 
         speedRegulation;
@@ -98,7 +102,7 @@ classdef Motor < MaskedHandle & dynamicprops
         % isRunning (bool): True if motor is running. [READ-ONLY]
         isRunning; 
         
-        % tachoCount (numeric): Current tacho count. [READ-ONLY]
+        % tachoCount (numeric): Current tacho count in degrees. [READ-ONLY]
         tachoCount;
         
         % currentSpeed (numeric): Current speed of motor. [READ-ONLY]
@@ -112,9 +116,8 @@ classdef Motor < MaskedHandle & dynamicprops
     end
     
     properties (Hidden, Access = private)  % Hidden properties for internal use only 
-        % commInterface (CommunicationInterface): Commands are created and sent via the 
-        %     communication interface class.
-        commInterface; 
+        % ev3Handle (EV3): Handle to the EV3-object to which this motor instance belongs
+        ev3Handle;
         
         % port (string): Motor port. This is only the string representation of the motor port 
         %     to work with. Internally, either MotorPort-, MotorBitfield- or MotorInput-member 
@@ -132,12 +135,13 @@ classdef Motor < MaskedHandle & dynamicprops
         % init (bool): Indicates init-phase (i.e. constructor is running).
         init = true;
         
-        % connectedToBrick (bool): True if virtual brick is connected to physical brick.
-        connectedToBrick = false;
-        
-        % state (MotorState): State-struct consisting of several special Motor-flags         
+        % state (MotorState): State-struct consisting of several special Motor-flags      .   
         % See also MOTORSTATE         
         state = MotorState();
+        
+        % currentSpeedRegulation (bool): speedRegulation-value with which the motor has been started
+        % See also SPEEDREGULATION
+        currentSpeedRegulation;
     end
     
     properties (Hidden, Dependent, Access = private)  % Hidden, dependent properties for internal use only
@@ -149,7 +153,7 @@ classdef Motor < MaskedHandle & dynamicprops
         % See also PORTNO
         portNo;
         
-        % portInput (PortInput): Internal number of motor port if accessed via input-opCodes 
+        % portInput (PortInput): Internal number of motor port if accessed via input-opCodes. 
         %    - Port 'A': 16
         %    - Port 'B': 17
         %    - Port 'C': 18
@@ -157,19 +161,19 @@ classdef Motor < MaskedHandle & dynamicprops
         % See also PORTINPUT
         portInput;
         
-        % isSynced (bool): True if motor is running in synced mode
+        % isSynced (bool): True if motor is running in synced mode.
         isSynced;
         
-        % isMaster (bool): True if motor is running in synced mode and has a slave
+        % isMaster (bool): True if motor is running in synced mode and has a slave.
         isMaster;
         
-        % isSlave (bool): True if motor is running in synced mode and has a master
+        % isSlave (bool): True if motor is running in synced mode and has a master.
         isSlave;
         
-        % physicalMotorConnected (bool): True if physical motor is connected to this port
+        % physicalMotorConnected (bool): True if physical motor is connected to this port.
         physicalMotorConnected;
         
-        % internalTachoCount (numeric): internal tacho counter used for positioning the motor with a limit
+        % internalTachoCount (numeric): internal tacho counter used for positioning the motor with a limit.
         internalTachoCount;
     end
     
@@ -178,12 +182,10 @@ classdef Motor < MaskedHandle & dynamicprops
         function motor = Motor(varargin)
             % Sets properties of Motor-object and indicates end of init-phase when it's done.
             %
-            % Notes:
-            %     * input-arguments will directly be handed to Motor.setProperties
-            %
             % Arguments:
             %     varargin: see setProperties(motor, varargin)
             %
+            % See also SETPROPERTIES / :meth:`setProperties(ev3, varargin)`
             
             motor.setProperties(varargin{:});
             motor.init = false;
@@ -191,33 +193,15 @@ classdef Motor < MaskedHandle & dynamicprops
         
         %% Brick functions
         function start(motor)
-            % Starts the motor
-            %
-            % Notes:
-            %     * Right now, alternatingly calling this function with and without tacho limit
-            %       may lead to unexpected behaviour. For example, if you run the motor without
-            %       a tacholimit for some time using Coast, then stop using Coast, and then try 
-            %       to run the with a tacholimit, it will stop sooner or later than expected, 
-            %       or may not even start at all. 
-            %     * (OLD)After calling one of the functions to control the motor with some kind of 
-            %       limit (which is done if limit~=0), the physical brick's power/speed value for
-            %       starting without a limit (i.e. if limit==0) is reset to zero. So if you want 
-            %       to control the motor without a limit after doing so with a limit, you would 
-            %       have to set the power manually to the desired value again. (I don't really 
-            %       know if this is deliberate or a bug, and at this point, I'm too afraid to ask.)
-            %       To avoid confusion, this is done automatically in this special case.
-            %       However, this does not even work all the time. If motor does not
-            %       start, call stop() and setPower() manually. :/
-            % 
+            % Starts the motor.
+            
+            if motor.isRunning
+                error('Motor is already running!');
+            end
             
-            % Check connection and if motor is already running
-            if ~motor.connectedToBrick
-                error('Motor::start: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected
-                error('Motor::start: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            elseif motor.isRunning
-                error('Motor::start: Motor is already running!');
+            if motor.speedRegulation ~= motor.currentSpeedRegulation
+                motor.currentSpeedRegulation = motor.speedRegulation; 
+                motor.state.sendOnStart = bitset(motor.state.sendOnStart, SendOnStart.Power, 1);
             end
             
             % If motor has been started synced with another, and it stopped 'itself' (when
@@ -258,7 +242,7 @@ classdef Motor < MaskedHandle & dynamicprops
                 motor.internalReset();
             end
 
-            % Call appropriate function in commInterface depending on limitValue and limitMode
+            % Send appropriate command depending on limitValue and limitMode
             if motor.limitValue==0
                 if motor.state.sendOnStart > 0
                     % If stop-flag is set: call stop() and reset flag
@@ -279,162 +263,129 @@ classdef Motor < MaskedHandle & dynamicprops
                     
                 end
                 
-                motor.commInterface.outputStart(0, motor.port);
+                motor.handleCommand(@outputStart, true, 0, motor.port);
                 
-                if motor.debug
-                    fprintf('(DEBUG) Motor::start: Called outputStart on Port %s\n', port2str('Motor', motor.port));
-                end
                 motor.state.startedNotBusy = true;
             else
                 limit = motor.limitValue - (motor.smoothStart + motor.smoothStop);
                 if limit < 0
-                    error(['Motor::start: smoothStart/Stop invalid. ' ,...
+                    error(['smoothStart/Stop invalid. ' ,...
                         'smoothStart + smoothStop has to be smaller than limitValue.']);
                 end
                 
                 if strcmpi(motor.limitMode, 'Tacho')
                     if motor.speedRegulation
-                        motor.commInterface.outputStepSpeed(0, motor.port, motor.power,...
+                        motor.handleCommand(@outputStepSpeed, true, 0, motor.port, motor.power,...
                             motor.smoothStart, limit, motor.smoothStop,...
                             motor.brakeMode_);
-                        
-                        if motor.debug
-                            fprintf('(DEBUG) Motor::start: Called outputStepSpeed on Port %s\n',...
-                                    port2str('Motor', motor.port));
-                        end
                     else
-                        motor.commInterface.outputStepPower(0, motor.port, motor.power,...
+                        motor.handleCommand(@outputStepPower, true, 0, motor.port, motor.power,...
                             motor.smoothStart, limit, motor.smoothStop,...
                             motor.brakeMode_);
-                        
-                        if motor.debug
-                            fprintf('(DEBUG) Motor::start: Called outputStepPower on Port %s\n',...
-                                    port2str('Motor', motor.port));
-                        end
                     end
                 elseif strcmpi(motor.limitMode, 'Time')
                     if motor.speedRegulation
-                        motor.commInterface.outputTimeSpeed(0, motor.port, motor.power,...
+                        motor.handleCommand(@outputTimeSpeed, true, 0, motor.port, motor.power,...
                             motor.smoothStart, limit, motor.smoothStop,...
                             motor.brakeMode_);
-                        
-                        if motor.debug
-                            fprintf('(DEBUG) Motor::start: Called outputTimeSpeed on Port %s\n',...
-                                    port2str('Motor', motor.port));
-                        end
                     else
-                        motor.commInterface.outputTimePower(0, motor.port, motor.power,...
+                        motor.handleCommand(@outputTimePower, true, 0, motor.port, motor.power,...
                             motor.smoothStart, limit, motor.smoothStop,...
                             motor.brakeMode_);
-                        
-                        if motor.debug
-                            fprintf('(DEBUG) Motor::start: Called outputTimePower on Port %s\n',...
-                                    port2str('Motor', motor.port));
-                        end
                     end
                 end
             end
         end
         
         function stop(motor)
-            % Stops the motor
-            
-            if ~motor.connectedToBrick
-                error('Motor::stop: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected
-                error('Motor::stop: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            elseif motor.isSynced && motor.isRunning
+            % Stops the motor.
+            %
+            % Notes:
+            %     * If this motor has been started synced with another one (either as master or
+            %       slave, using Motor.syncedStart), syncedStop() will be called, stopping both
+            %       motors.
+            %
+            % See also MOTOR.START, MOTOR.SYNCEDSTOP / :meth:`start`, :meth:`syncedStop`
+            
+            if motor.isSynced && motor.isRunning
                 motor.syncedStop();
                 return;
-%                 error(['Motor::stop: Motor is running synchronized with another motor. ' ,...
-%                        'Use ''syncedStop'' on the ''master''-motor.']);
             end
             
-            motor.commInterface.outputStop(0, motor.port, motor.brakeMode_);
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::stop: Called outputStop on Port %s\n', port2str('Motor', motor.port));
-            end
+            motor.handleCommand(@outputStop, false, 0, motor.port, motor.brakeMode_);
             
             motor.state.startedNotBusy = false;
         end
         
         function syncedStart(motor, syncMotor, varargin)
-            % Starts this motor synchronized with another
+            % Starts this motor synchronized with another.
             %
-            % This motor acts as a 'master', meaning that the synchronized control is done via
-            % this one. When syncedStart is called, the master sets some of the slave's 
-            % (syncMotor) properties to keep it consistent with the physical brick. So, for 
-            % example, changing the power on the master motor will take effect
-            % on the slave as soon as this method is called. 
-            % The following parameters will be affected on the slave: power, brakeMode,
-            % limitValue, speedRegulation
+            % The motor, with which this method is called, acts as a *master*, meaning that the 
+            % synchronized control is done with it und uses its parameters. When syncedStart is 
+            % called, the master sets some of the slave's (syncMotor) properties to keep it 
+            % consistent with the physical brick. So, for example, if the master has another 
+            % power-value than the slave, the slave's power-value will be set to that of the
+            % master when syncedStart() is called.
+            % The following parameters will be affected on the slave: *power*, *brakeMode*,
+            % *limitValue*, *speedRegulation*
             %
             % Arguments:
-            %     syncMotor (Motor): the motor-object to sync with
-            %     turnRatio (numeric in [-200,200]): *[OPTIONAL]* |br| (Excerpt of Firmware-comments, in c_output.c): 
-            %         "Turn ratio is how tight you turn and to what direction you turn. 
-            %             * 0 value is moving straight forward
-            %             * Negative values turn to the left
-            %             * Positive values turn to the right
-            %             * Value -100 stops the left motor
-            %             * Value +100 stops the right motor
-            %             * Values less than -100 makes the left motor run the opposite direction of the right motor (Spin)
-            %             * Values greater than +100 makes the right motor run the opposite direction of the left motor (Spin)" 
-            %
+            %     syncMotor (Motor): The motor-object to sync with
+            %     turnRatio (numeric in [-200,200]): Ratio between the two master's and the
+            %         slave's motor speed. With values!=0 one motor will be slower than the other
+            %         or even turn into the other direction. This can be used for turning car-like
+            %         robots, for example. *[OPTIONAL]* (Read in Firmware-comments in c_output.c): |br|
+            %         -> 0 is moving straight forward |br|
+            %         -> Negative values turn to the left |br|
+            %         -> Positive values turn to the right |br|
+            %         -> Value -100 stops the left motor |br|
+            %         -> Value +100 stops the right motor |br|
+            %         -> Values less than -100 makes the left motor run the opposite direction of the right motor (Spin) |br|
+            %         -> Values greater than +100 makes the right motor run the opposite direction of the left motor (Spin) |br|
+            %         
             % Notes:
-            %     * This is right now a pretty 'heavy' function, as it tests if both motors are
-            %       connected AND aren't running, wasting four packets, keep that in mind
-            %     * It is necessary to call syncedStop() and not stop() for stopping the motors 
-            %       (otherwise the sync-state cannot be exited correctly)
+            %     * This is a pretty 'heavy' function, as it tests if both motors are
+            %       connected AND aren't running, wasting four packets, keep that in mind.
             %
             % Example:
-            %     b = EV3(); |br|
-            %     b.connect('usb'); |br|
-            %     m = b.motorA; |br|
-            %     slave = b.motorB; |br|
-            %     m.power = 50; |br|
-            %     m.syncedStart(slave); |br|
-            %     % Do stuff
-            %     m.syncedStop(); |br|
-            %
+            %     b = EV3(); % |br|
+            %     b.connect('usb'); % |br|
+            %     m = b.motorA; % |br|
+            %     slave = b.motorB; % |br|
+            %     m.power = 50; % |br|
+            %     m.syncedStart(slave); % |br|
+            %     % Do stuff |br|
+            %     m.stop(); % |br|
+            % 
+            % See also MOTOR.STOP, MOTOR.SYNCEDSTOP / :meth:`stop`, :meth:`syncedStop`
+            
             turnRatio = 0;
             
             % Check parameters
             if ~isDeviceValid('Motor', syncMotor)
-                error('Motor::syncedStart: Given motor to sync with is not a valid motor object.');
+                error('Given motor to sync with is not a valid motor object.');
             elseif ~isempty(varargin)
                 if length(varargin)~=2
-                    error(['Motor::syncedStart: Wrong number of input arguments. ' ,...
+                    error(['Wrong number of input arguments. ' ,...
                            'Possible input: ''turnRatio'', value (with value in [-200,200])']); 
                 end
                 parameter = varargin{1};
                 turnRatio = varargin{2};
                 if ~strcmpi(parameter, 'turnRatio') || ~isnumeric(turnRatio) || ...
                         turnRatio<-200 || turnRatio > 200
-                    error(['Motor::syncedStart: Wrong format of input arguments. Possible ',...
+                    error(['Wrong format of input arguments. Possible ',...
                            'input: ''turnRatio'', value (with value in [-200,200])']); 
                 end
             end
             
             % Check connection and motor parameter
-            if ~motor.connectedToBrick || ~syncMotor.connectedToBrick
-                error('Motor::syncedStart: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected || ~syncMotor.physicalMotorConnected
-                error('Motor::syncedStart: No physical motor connected to Port %s or %s.',...
-                    port2str('Motor', motor.port), port2str('Motor', syncMotor.port));
-            elseif motor.speedRegulation
-                error(['Motor::syncedStart: Cannot run motors synchronized if ',...
+            if motor.speedRegulation
+                error(['Cannot run motors synchronized if ',...
                     'speedRegulation is turned on.']);
             elseif motor.isRunning || syncMotor.isRunning
-                error('Motor::syncedStart: One of the motors is already running!');
+                error('One of the motors is already running!');
             end
             
-%             if motor.power == 0
-%                 warning('Motor::syncedStart: Synchronized motors starting with power=0.');
-%             end
-            
             % If the motor coasts into its stops, the internal tachocount has to be reset 
             % before each start for it to behave predictable
             if motor.brakeMode_ == BrakeMode.Coast || motor.internalTachoCount ~= 0
@@ -477,31 +428,27 @@ classdef Motor < MaskedHandle & dynamicprops
            
             
             if strcmpi(motor.limitMode, 'Tacho')
-               motor.commInterface.outputStepSync(0, motor.port+syncMotor.port, ...
+               motor.handleCommand(@outputStepSync, true, 0, motor.port+syncMotor.port, ...
                                               motor.power, turnRatio, ...
                                               motor.limitValue, motor.brakeMode_);
-               if motor.debug
-                   fprintf(['(DEBUG) Motor::syncedStart: Called outputStepSync on ' ,...
-                           'Ports %s and %s.\n'], port2str('Motor', motor.port), port2str('Motor', syncMotor.port));
-               end
             elseif strcmpi(motor.limitMode, 'Time')
-                motor.commInterface.outputTimeSync(0, motor.port+syncMotor.port, ...
+               motor.handleCommand(@outputTimeSync, true, 0, motor.port+syncMotor.port, ...
                                               motor.power, turnRatio, ...
-                                              motor.limitValue, motor.brakeMode_); 
-               if motor.debug
-                   fprintf('(DEBUG) Motor::start: Called outputStepSync on Ports %s and %s.\n',...
-                         port2str('Motor', motor.port), port2str('Motor', syncMotor.port));
-               end
+                                              motor.limitValue, motor.brakeMode_);
             end
         end
         
         function syncedStop(motor)
             % Stops both motors previously started with syncedStart.
             %
-            % See also MOTOR.SYNCEDSTART
+            % Notes:
+            %     * This method is called automatically by stop(), if the motors have been
+            %       started using syncedStart, and the regular stop-method has been called afterwards.
+            %
+            % See also MOTOR.SYNCEDSTART, MOTOR.STOP / :meth:`syncedStart`, :meth:`stop`
             
             if ~motor.isSynced
-                error('Motor::syncedStop: Motor has not been started synchronized with another.');
+                error('Motor has not been started synchronized with another.');
             else
                 % Retrieve synced motor from cache
                 if motor.isMaster
@@ -515,19 +462,12 @@ classdef Motor < MaskedHandle & dynamicprops
                 end
             end 
             
-            if ~motor.connectedToBrick || ~syncMotor.connectedToBrick
-                error('Motor::syncedStop: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected || ~syncMotor.physicalMotorConnected
-                error('Motor::syncedStop: No physical motor connected to either Port %s or %s.',...
-                    port2str('Motor', motor.port), port2str('Motor', syncMotor.port));
-            end
-            
             % Reset state
             motor.applyState();
             syncMotor.applyState();
             
             % Synced stopping
-            motor.commInterface.outputStop(0, motor.port+syncMotor.port, motor.brakeMode_);
+            motor.handleCommand(@outputStop, false, 0, motor.port+syncMotor.port, motor.brakeMode_);
             
             % On next start, both motors have to send power-opcode again
             if motor.state.sendPowerOnSet
@@ -536,74 +476,30 @@ classdef Motor < MaskedHandle & dynamicprops
             if syncMotor.state.sendPowerOnSet
                 syncMotor.state.sendOnStart = bitset(syncMotor.state.sendOnStart, SendOnStart.Power, 1);
             end
-            
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::syncedStop: Called outputStop on Ports %s and %s.\n', ...
-                    port2str('Motor', motor.port), port2str('Motor', syncMotor.port));
-            end
         end
         
         function waitFor(motor)
-            % Stops execution of program as long as motor is running
+            % Stops execution of program as long as motor is running.
             %
             % Notes:
-            %     * (OLD)This one's a bit tricky. The opCode OutputReady makes the brick stop sending
+            %     * This one's a bit tricky. The opCode which is supposed to be used here, OutputReady,
+            %       makes the brick stop sending
             %       responses until the motor has stopped. For security reasons, in this toolbox 
             %       there is an internal timeout for receiving messages from the brick. It raises
             %       an error if a reply takes too long, which would happen in this case. As a
             %       workaround, there is an infinite loop that catches errors from outputReady and
             %       continues then, until outputReady will actually finish without an error.
-            %     * (OLD)OutputReady (like OutputTest in isRunning) sometimes doesn't work. If 
-            %       outputReady returns in less than a second, another while-loop iterates until 
-            %       the motor has stopped, this time using motor.isRunning() (this only works as 
-            %       long as not both OutputTest and OutputReady are buggy).
-            %     * (OLD)Workaround: Poll isRunning (which itself return (speed>0)) until it
-            %       is false (No need to check if motor is connected as speed correctly 
-            %       returns 0 if it's not)
-            
-            if ~motor.connectedToBrick
-                error('Motor::waitFor: Motor-Object not connected to comm handle.');
-            end
+            %     * Workaround: Poll isRunning until it is false (No need to check if motor is 
+            %       connected as speed correctly returns 0 if it's not)
             
-            %pause(0.1);
             while motor.isRunning
-                 pause(0.03);
+                 pause(0.03); 
             end
-%             elseif ~motor.limitValue
-%                 error(['Motor::waitFor: Motor has no tacho limit. ' ,...
-%                          'Can''t reliably determine whether it is running or not.']);
-%             end
-%             
-%             tic;
-%             while 1
-%                 try
-%                     warning('off','all');
-%                     
-%                     motor.commInterface.outputReady(0, motor.port);
-%                     t = toc;
-%                     
-%                     if t < 1
-%                         while motor.isRunning()  % If outputReady correctly returned in less 
-%                                                  % than a second, isRunning should instantly send 0.
-%                         end
-%                     end
-%                     
-%                     warning('on','all');
-%                     break;
-%                 catch  % TO DO: Catch only timeout exception, otherwise death and destruction possible (aka infinite loop)
-%                     continue;
-%                 end
-%             end
-%             
-%             if motor.debug
-%                 fprintf('(DEBUG) Motor::waitFor: Called outputReady on Port %s\n', motor.port);
-%             end
         end
 		
         function internalReset(motor)
             % Resets internal tacho count. Use this if motor behaves weird (i.e. not starting at all, or not correctly
-            % running to limitValue)
+            % running to limitValue).
             %
             % The internal tacho count is used for positioning the motor. When the
             % motor is running with a tacho limit, internally it uses another counter than the
@@ -613,54 +509,36 @@ classdef Motor < MaskedHandle & dynamicprops
             %
             % Notes:
             %     * A better name would probably be resetPosition...
-            %     * Gets called automatically when starting the motor and the internal tacho
-            %     count is > 0
+            %     * Gets called automatically when starting the motor and the internal tacho count is > 0
             %       
             %
-            % See also MOTOR.RESETTACHOCOUNT
-            
-            if ~motor.connectedToBrick
-                error(['Motor::internalReset: Motor-Object not connected to brick handle.',...
-                       'You have to call motor.connect(brick) first!']);
-            elseif ~motor.physicalMotorConnected
-                error('Motor::internalReset: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            end
+            % See also MOTOR.RESETTACHOCOUNT / :attr:`resetTachoCount`
             
-            motor.commInterface.outputReset(0, motor.port);
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::internalReset: Called outputReset on Port %s\n',...
-                          port2str('Motor', motor.port));
-            end
+            motor.handleCommand(@outputReset, false, 0, motor.port);
         end
         
         function resetTachoCount(motor)
-            % Resets tachocount
-            
-            if ~motor.connectedToBrick
-                error('Motor::resetTachoCount: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected
-                error('Motor::resetTachoCount: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            end
-            
-            motor.commInterface.outputClrCount(0, motor.port);
+            % Resets tachocount.
+            %
+            % See also MOTOR.TACHOCOUNT / :attr:`tachoCount`
             
-            if motor.debug
-                fprintf('(DEBUG) Motor::resetTachoCount: Called outputClrCount on Port %s\n',...
-                          port2str('Motor', motor.port));
-            end
+            motor.handleCommand(@outputClrCount, false, 0, motor.port);
         end
         
         function setBrake(motor, brake)
-            % Apply or release brake of motor
+            % Apply or release brake of motor.
             %
             % Arguments:
             %     brake (bool): If true, brake will be pulled
+            %
+            % Notes:
+            %     * This method does not affect Motor.brakeMode. After the next run, the motor
+            %       will again be stopped as specified in Motor.brakeMode.
+            %
+            % See also MOTOR.BRAKEMODE / :attr:`brakeMode`
             
             if ~isBool(brake)
-                error('Motor::setBrake: Given parameter is not a valid bool.');
+                error('Given parameter is not a valid bool.');
             else
                 brake = str2bool(brake);
             end
@@ -678,10 +556,10 @@ classdef Motor < MaskedHandle & dynamicprops
         %% Setter
         function set.power(motor, power)
             if ~isnumeric(power)
-                error('Motor::set.power: Given parameter is not a numeric.');
+                error('Given parameter is not a numeric.');
             elseif power<-100 || power>100
-                warning('Motor::set.power: Motor power has to be an element of [-100,100]!');
-                error('Motor::set.power: Given motor power is out of bounds.');
+                warning('Motor power has to be an element of [-100,100]!');
+                error('Given motor power is out of bounds.');
             end
             
             motor.power = power;  % Set power parameter.
@@ -698,32 +576,48 @@ classdef Motor < MaskedHandle & dynamicprops
         
         function set.speedRegulation(motor, speedRegulation)
             if ~isBool(speedRegulation)
-                error('Motor::set.speedRegulation: Given parameter is not a bool.');
-%             elseif motor.connectedToBrick && motor.physicalMotorConnected && ~motor.speedRegulation && speedRegulation 
-%                 pause(0.5);
-%                 if motor.isRunning 
-%                     error(['Motor::set.speedRegulation: Cannot change speed regulation while ', ...
-%                         'is motor is moving.']);
-%                 end
+                error('Given parameter is not a bool.');
             end
             
             speedRegulation = str2bool(speedRegulation);
             
-            if ~isempty(motor.speedRegulation) && (speedRegulation ~= motor.speedRegulation)
-                if motor.state.sendPowerOnSet
-                    motor.state.sendOnStart = bitset(motor.state.sendOnStart, SendOnStart.Power, 1);
+            if speedRegulation ~= motor.speedRegulation
+                if ~isempty(motor.speedRegulation) 
+                    if motor.state.sendPowerOnSet
+                        motor.state.sendOnStart = bitset(motor.state.sendOnStart, SendOnStart.Power, 1);
+                    end
+                end
+
+                if ~motor.isRunning
+                    motor.currentSpeedRegulation = speedRegulation;
                 end
             end
             
             motor.speedRegulation = speedRegulation;
         end
         
+        function set.currentSpeedRegulation(motor, currentSpeedRegulation)
+            if ~isBool(currentSpeedRegulation)
+                error('Given parameter is not a bool.');
+            end
+            
+            currentSpeedRegulation = str2bool(currentSpeedRegulation);
+            
+%             if ~isempty(motor.speedRegulation) && (speedRegulation ~= motor.speedRegulation)
+%                 if motor.state.sendPowerOnSet
+%                     motor.state.sendOnStart = bitset(motor.state.sendOnStart, SendOnStart.Power, 1);
+%                 end
+%             end
+            
+            motor.currentSpeedRegulation = currentSpeedRegulation;
+        end
+        
         function set.smoothStart(motor, steps)
             if ~isnumeric(steps)
-                error('Motor::set.smoothStart: Given parameter is not a numeric.');
+                error('Given parameter is not a numeric.');
             elseif steps<0
-                warning('Motor::set.smoothStart: Smooth start steps have to be positive.');
-                error('Motor::set.smoothStart: Smooth start steps are out of bounds.');
+                warning('Smooth start steps have to be positive.');
+                error('Smooth start steps are out of bounds.');
             end
             
             motor.smoothStart = steps;
@@ -731,10 +625,10 @@ classdef Motor < MaskedHandle & dynamicprops
         
         function set.smoothStop(motor, steps)
             if ~isnumeric(steps)
-                error('Motor::set.smoothStop: Given parameter is not a numeric.');
+                error('Given parameter is not a numeric.');
             elseif steps<0
-                warning('Motor::set.smoothStop: Smooth stop steps have to be positive.');
-                error('Motor::set.smoothStop: Smooth stop steps are out of bounds.');
+                warning('Smooth stop steps have to be positive.');
+                error('Smooth stop steps are out of bounds.');
             end
             
             motor.smoothStop = steps;
@@ -743,14 +637,13 @@ classdef Motor < MaskedHandle & dynamicprops
         function set.brakeMode(motor, brakeMode)
             if ~ischar(brakeMode) ||  ...
                 (~strcmpi(brakeMode, 'coast') && ~strcmpi(brakeMode, 'brake'))
-                error('Motor::set.brakeMode: Given parameter is not a valid brake mode.');
+                error('Given parameter is not a valid brake mode.');
             end 
             
             % If new brakeMode is 'Brake': reset internal tachocount once
             % Note: if new brakeMode is 'Coast', internal tachocount is always reset
             %       right before starting, so it's not necessary here
-            if ~motor.init && strcmpi(brakeMode,'Brake') && ... 
-                    motor.connectedToBrick && motor.physicalMotorConnected
+            if ~motor.init && strcmpi(brakeMode,'Brake')
                 motor.internalReset();
             end
             
@@ -762,7 +655,7 @@ classdef Motor < MaskedHandle & dynamicprops
         function set.limitMode(motor, limitMode)
             if ~ischar(limitMode) ||  ...
                 (~strcmpi(limitMode, 'tacho') && ~strcmpi(limitMode, 'time'))
-                error('Motor::set.limitMode: Given parameter is not a valid limit mode.');
+                error('Given parameter is not a valid limit mode.');
             end 
             
             motor.limitMode = limitMode;
@@ -770,10 +663,10 @@ classdef Motor < MaskedHandle & dynamicprops
         
         function set.limitValue(motor, limitValue)
             if ~isnumeric(limitValue)
-                error('Motor::set.limitValue: Given parameter is not a numeric.');
+                error('Given parameter is not a numeric.');
             elseif limitValue<0
-                warning('Motor::set.limitValue: limitValue has to be positive!');
-                error('Motor::set.limitValue: Given limitValue is out of bounds.');
+                warning('limitValue has to be positive!');
+                error('Given limitValue is out of bounds.');
             end    
                
             if limitValue == 0
@@ -787,28 +680,20 @@ classdef Motor < MaskedHandle & dynamicprops
                 motor.state.sendPowerOnSet = false;
             end
             
-            motor.limitValue= limitValue;
+            motor.limitValue = limitValue;
         end
         
         function set.port(motor, port)
             try
                 motor.port = str2PortParam(class(motor), port);
             catch ME
-                error('Motor::set.port: Given parameter is not valid port string.');
+                error('Given parameter is not valid port string.');
             end
         end
         
-        function set.commInterface(motor, comm)
-            if ~isCommInterfaceValid(comm)
-                error('Motor::set.commInterface: Handle to commInterface not valid.');
-            end
-            
-            motor.commInterface = comm;
-        end
-        
         function set.debug(motor, debug)
             if ~isBool(debug)
-                error('Motor::set.debug: Given parameter is not a bool.');
+                error('Given parameter is not a bool.');
             end
             
             motor.debug = str2bool(debug);
@@ -818,20 +703,20 @@ classdef Motor < MaskedHandle & dynamicprops
             % Sets multiple Motor properties at once using MATLAB's inputParser.
             %
             % Arguments:
-            %     debug (bool) *[OPTIONAL]*
-            %     smoothStart (numeric in [0, limitValue]) *[OPTIONAL]*
-            %     smoothStop (numeric in [0, limitValue]) *[OPTIONAL]*
-            %     speedRegulation (bool) *[OPTIONAL]*
-            %     brakeMode ('Coast'|'Brake') *[OPTIONAL]*
-            %     limitMode ('Time'|'Tacho') *[OPTIONAL]*
-            %     limitValue (numeric > 0) *[OPTIONAL]*
-            %     power (numeric in [-100,100]) *[OPTIONAL]*
-            %     batteryMode ('Voltage'|'Percentage') *[OPTIONAL]*
+            %     debug (bool): *[OPTIONAL]*
+            %     smoothStart (numeric in [0, limitValue]): *[OPTIONAL]*
+            %     smoothStop (numeric in [0, limitValue]): *[OPTIONAL]*
+            %     speedRegulation (bool): *[OPTIONAL]*
+            %     brakeMode ('Coast'|'Brake'): *[OPTIONAL]*
+            %     limitMode ('Time'|'Tacho'): *[OPTIONAL]*
+            %     limitValue (numeric > 0): *[OPTIONAL]*
+            %     power (numeric in [-100,100]): *[OPTIONAL]*
+            %     batteryMode ('Voltage'|'Percentage'): *[OPTIONAL]*
             %
             % Example:
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
-            %     b.motorA.setProperties('debug', 'on', 'power', 50, 'limitValue', 720, 'speedRegulation', 'on'); |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
+            %     b.motorA.setProperties('debug', 'on', 'power', 50, 'limitValue', 720, 'speedRegulation', 'on'); % |br|
             %     % Instead of: b.motorA.debug = 'on'; |br| 
             %     %             b.motorA.power = 50; |br|
             %     %             b.motorA.limitValue = 720; |br|
@@ -865,6 +750,7 @@ classdef Motor < MaskedHandle & dynamicprops
             % Add parameter
             if motor.init
                 p.addRequired('port');
+                p.addRequired('ev3Handle');
             end
             p.addOptional('debug', defaultDebug);
             p.addOptional('speedRegulation', defaultSpeedReg);
@@ -881,6 +767,7 @@ classdef Motor < MaskedHandle & dynamicprops
             % Set properties
             if motor.init
                motor.port = p.Results.port; 
+               motor.ev3Handle = p.Results.ev3Handle;
             end
             motor.power = p.Results.power;
             motor.limitValue= p.Results.limitValue;
@@ -888,6 +775,7 @@ classdef Motor < MaskedHandle & dynamicprops
             motor.brakeMode = p.Results.brakeMode;
             motor.debug = p.Results.debug;
             motor.speedRegulation = p.Results.speedRegulation;
+            motor.currentSpeedRegulation = p.Results.speedRegulation;
             motor.smoothStart = p.Results.smoothStart;
             motor.smoothStop = p.Results.smoothStop;
         end
@@ -903,10 +791,10 @@ classdef Motor < MaskedHandle & dynamicprops
         
         function cnt = get.tachoCount(motor)
             cnt = 0;
-            if motor.connectedToBrick
+            if motor.ev3Handle.isConnected
                 cnt = motor.getTachoCount();
                 if isnan(cnt)
-                    warning('Motor::get.tachoCount: Could not detect motor at port %s.', ...
+                    warning('Could not detect motor at port %s.', ...
                         port2str('Motor', motor.port));
                     cnt = 0;
                 end
@@ -915,10 +803,10 @@ classdef Motor < MaskedHandle & dynamicprops
         
         function cnt = get.internalTachoCount(motor)
             cnt = 0;
-            if motor.connectedToBrick
+            if motor.ev3Handle.isConnected
                 cnt = motor.getInternalTachoCount();
                 if isnan(cnt)
-                    warning('Motor::get.internalTachoCount: Could not detect motor at port %s.', ...
+                    warning('Could not detect motor at port %s.', ...
                         port2str('Motor', motor.port));
                     cnt = 0;
                 end
@@ -927,10 +815,10 @@ classdef Motor < MaskedHandle & dynamicprops
         
         function speed = get.currentSpeed(motor)
             speed = 0;
-            if motor.connectedToBrick
+            if motor.ev3Handle.isConnected
                 speed = motor.getSpeed();
                 if isnan(speed)
-                    warning('Motor::get.currentSpeed: Could not detect motor at port %s.', ...
+                    warning('Could not detect motor at port %s.', ...
                         port2str('Motor', motor.port));
                     speed = 0;
                 end
@@ -938,18 +826,27 @@ classdef Motor < MaskedHandle & dynamicprops
         end
         
         function running = get.isRunning(motor)
-            running = 0;
-            
-            if motor.connectedToBrick
+            busyFlag = 0;
+            if motor.ev3Handle.isConnected
                 busyFlag = motor.getBusyFlag();
-            else
-                busyFlag = 0;
             end
             
-            % assert(~(motor.state.startedNotBusy && busyFlag));
             running = motor.state.startedNotBusy || busyFlag;
         end
         
+        function motorType = get.type(motor)
+            motorType = DeviceType.Unknown;
+            
+            if motor.ev3Handle.isConnected
+                [motorType, ~] = motor.getTypeMode();
+            end
+        end
+        
+        function conn = get.physicalMotorConnected(motor)
+            currentType = motor.type;
+            conn = (currentType==DeviceType.MediumMotor || currentType==DeviceType.LargeMotor);
+        end
+        
         function synced = get.isSynced(motor)
             synced = motor.isSlave || motor.isMaster;
         end
@@ -962,19 +859,6 @@ classdef Motor < MaskedHandle & dynamicprops
             isMaster = length(findprop(motor, 'slave'))==1;
         end
         
-        function motorType = get.type(motor)
-            if motor.connectedToBrick
-                [motorType, ~] = motor.getTypeMode();
-            else
-                motorType = DeviceType.Unknown;
-            end
-        end
-        
-        function conn = get.physicalMotorConnected(motor)
-            currentType = motor.type;
-            conn = (currentType==DeviceType.MediumMotor || currentType==DeviceType.LargeMotor);
-        end
-        
         %% Display
         function display(motor)
             displayProperties(motor); 
@@ -982,8 +866,38 @@ classdef Motor < MaskedHandle & dynamicprops
     end
     
     methods (Access = private)  % Private functions that directly interact with commLayer
-        function success = setPower(motor, power)
-            %setPower Sets given power value on the physical Brick.
+        function varargout = handleCommand(motor, command, checkDevice, varargin)
+            % Execute a CommunicationInterface-method given as a handle
+            %
+            % As those methods have different, fixed numbers of output arguments, this quantity
+            % has to be retrieved first.
+            
+            if ~motor.ev3Handle.isConnected
+                msg = ['Not connected to physical brick. ',...
+                       'You have to call connect(...) on the EV3 object first!'];
+                id = [ID(), ':', 'NoConnection'];
+                
+                throw(MException(id, msg));
+            elseif checkDevice && ~motor.physicalMotorConnected
+                msg = ['Could not detect motor at port ', port2str('Motor', motor.port), '.'];
+                id = [ID(), ':', 'NoDevice'];
+                
+                throw(MException(id, msg));
+            end
+            
+            if motor.debug
+                fprintf('(DEBUG) Sending %s\n', func2str(command));
+            end
+            
+            % Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
+            % do this ugly workaround using strings. See 
+            % https://de.mathworks.com/matlabcentral/answers/96617-how-can-i-use-nargin-nargout-to-determine-the-number-of-input-output-arguments-of-an-object-method
+            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(command)));
+            [varargout{1:nOut}] = motor.ev3Handle.dispatch(command, nOut, varargin{:});
+        end
+        
+        function success = setPower(motor, power) %% TODO
+            % Sets given power value on the physical Brick.
             %
             % Notes:
             %     * If motor is running with a limit, calling outputSpeed/outputPower, to
@@ -995,109 +909,44 @@ classdef Motor < MaskedHandle & dynamicprops
             % Returns:
             %     success (bool): if true, power has successfully been set
             
-            if ~motor.connectedToBrick || ~motor.physicalMotorConnected
-%                 error('Motor::getTachoCount: Motor-Object not connected to comm handle.');
+            if ~motor.ev3Handle.isConnected || ~motor.physicalMotorConnected
                 success = false;
                 return;
-            end
+            end;
             
-            % assert(motor.physicalMotorConnected==true);
-            % assert(motor.limitValue==0);
-            
-            if motor.speedRegulation
-                motor.commInterface.outputSpeed(0, motor.port, power);
-
-                if motor.debug
-                    fprintf('(DEBUG) Motor::setPower: Called outputSpeed on Port %s\n', port2str('Motor', motor.port));
-                end
+            if motor.currentSpeedRegulation
+                motor.handleCommand(@outputSpeed, true, 0, motor.port, power);
             else
-                motor.commInterface.outputPower(0, motor.port, power);
-
-                if motor.debug
-                    fprintf('(DEBUG) Motor::setPower: Called outputPower on Port %s\n', port2str('Motor', motor.port));
-                end
+                motor.handleCommand(@outputPower, true, 0, motor.port, power);
             end
             success = true;
             return;
         end
         
-        function setMode(motor, mode)  %% DEPRECATED
-            if ~motor.connectedToBrick
-                error('Motor::getTachoCount: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected
-                error('Motor::getTachoCount: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            end
-            
-            motor.commInterface.inputReadSI(0, motor.portInput, mode);  % Reading a value implicitly 
-                                                                        % sets the mode.
-
-            if motor.debug
-                fprintf('(DEBUG) Motor::setMode: Called inputReadSI on Port %s\n',...
-                         port2str('Motor', motor.port));
-            end        
-        end
-        
         function [type,mode] = getTypeMode(motor)
-            if ~motor.connectedToBrick
-                error('Motor::getTypeMode: Motor-Object not connected to comm handle.');
-            end
-            
-            [typeNo,modeNo] = motor.commInterface.inputDeviceGetTypeMode(0, motor.portInput);
+            [typeNo, modeNo] = motor.handleCommand(@inputDeviceGetTypeMode, false, 0, motor.portInput);
             type = DeviceType(typeNo);
             mode = DeviceMode(type,modeNo);
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::getTypeMode: Called inputDeviceGetTypeMode on Port %s\n',...
-                         port2str('Motor', motor.port));
-            end
         end
         
         function status = getStatus(motor)
-            if ~motor.connectedToBrick
-                error('Motor::getStatus: Motor-Object not connected to comm handle.');
-            end
-            
-            statusNo = motor.commInterface.inputDeviceGetConnection(0, motor.portInput);
+            statusNo = motor.handleCommand(@inputDeviceGetConnection, false, 0, motor.portInput);
             status = ConnectionType(statusNo);
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::getStatus: Called inputDeviceGetConnection on Port %s\n',...
-                         port2str('Motor', motor.port));
-            end
         end
         
         function cnt = getTachoCount(motor)
-            if ~motor.connectedToBrick
-                error('Motor::getTachoCount: Motor-Object not connected to comm handle.');
-            end
-            
-            cnt = motor.commInterface.outputGetCount(0, motor.portNo);
-            if motor.debug
-                fprintf('(DEBUG) Motor::getTachoCount: Called outputGetCount on Port %s\n', port2str('Motor', motor.port));
-            end
+            cnt = motor.handleCommand(@outputGetCount, false, 0, motor.portNo);
         end
         
         function cnt = getInternalTachoCount(motor)
-            [~, cnt] = motor.commInterface.outputRead(0, motor.portNo);
-            if motor.debug
-                fprintf('(DEBUG) Motor::getInternalTachoCount: Called outputRead on Port %s\n', port2str('Motor', motor.port));
-            end
+            [~, cnt] = motor.handleCommand(@outputRead, false, 0, motor.portNo);
         end
         
         function speed = getSpeed(motor)
-            if ~motor.connectedToBrick
-                error('Motor::getSpeed: Motor-Object not connected to comm handle.');
-            end
-            
-            speed = motor.commInterface.inputReadSI(0, motor.portInput, DeviceMode.Motor.Speed);
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::getSpeed: Called inputReadSI on Port %s\n', port2str('Motor', motor.port));
-            end
+            speed = motor.handleCommand(@inputReadSI, false, 0, motor.portInput, DeviceMode.Motor.Speed);
         end
         
-        function busy = getBusyFlag(motor)
+        function busy = getBusyFlag(motor) %% TODO
             %getMotorStatus Returns whether motor is busy or not. 
             %
             % Notes:
@@ -1105,64 +954,35 @@ classdef Motor < MaskedHandle & dynamicprops
             %       called immediately after starting the motor.
             %     * Busy is set to true if motor is running with tacholimit or synced
             %
-            
-            if ~motor.connectedToBrick
-                error('Motor::getBusyFlag: Motor-Object not connected to comm handle.');
-            end
-            
-            busy = motor.commInterface.outputTest(0, motor.port);
-            
-            if motor.debug
-                fprintf('(DEBUG) Motor::getBusyFlag: Called outputTest on Port %s\n', port2str('Motor', motor.port));
-            end
+            busy = motor.handleCommand(@outputTest, false, 0, motor.port);
         end
         
         function applyBrake(motor)
-            if ~motor.connectedToBrick
-                error('Motor::applyBrake: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected
-                error('Motor::applyBrake: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            elseif motor.currentSpeed~=0
-                error('Motor::applyBrake: Can''t apply brake because Motor is moving');
+            if motor.currentSpeed~=0
+                error('Can''t apply brake because Motor is moving');
             end
             
             if motor.speedRegulation 
-                motor.commInterface.outputPower(0, motor.port, 0);
+                motor.handleCommand(@outputPower, true, 0, motor.port, 0);
             else
-                motor.commInterface.outputSpeed(0, motor.port, 0);
-            end
-            motor.commInterface.outputStart(0, motor.port);
-            motor.commInterface.outputStop(0, motor.port, BrakeMode.Brake);
-            
-            if motor.debug
-                fprintf(['(DEBUG) Motor::applyBrake: Called outputPower, outputStart and' ,...
-                    'outputStop on Port %s\n'], port2str('Motor', motor.port));
+                motor.handleCommand(@outputSpeed, true, 0, motor.port, 0);
             end
+            motor.handleCommand(@outputStart, false, 0, motor.port);
+            motor.handleCommand(@outputStop, false, 0, motor.port, BrakeMode.Brake);
         end
         
         function releaseBrake(motor)
-            if ~motor.connectedToBrick
-                error('Motor::releaseBrake: Motor-Object not connected to comm handle.');
-            elseif ~motor.physicalMotorConnected
-                error('Motor::releaseBrake: No physical motor connected to Port %s',...
-                       port2str('Motor', motor.port));
-            elseif motor.currentSpeed~=0
-                error('Motor::releaseBrake: Can''t release brake because Motor is moving');
+            if motor.currentSpeed~=0
+                error('Can''t release brake because Motor is moving');
             end
             
             if motor.speedRegulation 
-                motor.commInterface.outputPower(0, motor.port, 0);
+                motor.handleCommand(@outputPower, true, 0, motor.port, 0);
             else
-                motor.commInterface.outputSpeed(0, motor.port, 0);
-            end
-            motor.commInterface.outputStart(0, motor.port);
-            motor.commInterface.outputStop(0, motor.port, BrakeMode.Coast);
-            
-            if motor.debug
-                fprintf(['(DEBUG) Motor::releaseBrake: Called outputPower, outputStart and' ,...
-                    'outputStop on Port %s\n'], port2str('Motor', motor.port));
+                motor.handleCommand(@outputSpeed, true, 0, motor.port, 0);
             end
+            motor.handleCommand(@outputStart, false, 0, motor.port);
+            motor.handleCommand(@outputStop, false, 0, motor.port, BrakeMode.Coast);
         end
     end
     
@@ -1184,8 +1004,6 @@ classdef Motor < MaskedHandle & dynamicprops
             %applyState Sets motor state to saved state and deletes the dynamic property in
             %which the latter is stored
             
-            %assert(length(motor.findprop('savedState')) ~= 0);
-            
             motor.state = motor.savedState;
             delete(motor.findprop('savedState'))
         end
@@ -1200,7 +1018,7 @@ classdef Motor < MaskedHandle & dynamicprops
                 meta.Hidden = true;
                 meta.Access = 'private';
             elseif ~override
-                error('Motor::addProperty: Motor already has this property.');
+                error('Motor already has this property.');
             end
             
             motor.(propName) = propValue;
@@ -1208,57 +1026,14 @@ classdef Motor < MaskedHandle & dynamicprops
     end
     
     methods (Access = ?EV3)
-        function connect(motor,commInterface)
-            %connect Connects Motor-object to physical brick.
-            %
-            % Notes:
-            %     * This method is automatically called by EV3.connect()
-            %     * This method actually only saves a handle to a Brick-object which has been
-            %       created beforehand (probably by an EV3-object). 
-            %
-            % Arguments:
-            %     commInterface (CommunicationInterface): Handle to a communication interface
-            %         device
-            %
-            
-            if motor.connectedToBrick
-                if isCommInterfaceValid(motor.commInterface)
-                    error('Motor::connect: Motor-Object already has a comm handle.');
-                else
-                    warning(['Motor::connect: Motor.connectedToBrick is set to ''True'', but ',...
-                             'comm handle is invalid. Deleting invalid handle and ' ,...
-                             'resetting Motor.connectedToBrick now...']);
-                         
-                    motor.disconnect();
-                    
-                    error('Motor::connect: Disconnected due to internal error.');
-                end
-            end
-            
-            motor.commInterface = commInterface;
-            motor.connectedToBrick = true;
-            
-            if motor.debug
-               fprintf('(DEBUG) Motor-Object connected to comm handle.\n'); 
-            end
-        end
-        
-        function disconnect(motor)
-            %disconnect Disconnects Motor-object from physical brick.
-            %
-            % Notes:
-            %     * This method is automatically called by EV3.disconnect()
-            %     * This method actually only sets the property, in which 
-            %       the handle to the CommInterface-class was stored, to 0. 
+        function resetPhysicalMotor(motor)
+            % Stop motor, release brakes and reset all tacho counts.
             %
+            % Notes: 
+            %     * This is called automatically on disconnect
             
-            motor.commInterface = 0;
-            motor.connectedToBrick = false;
-        end
-        
-        function resetPhysicalMotor(motor)
-            % Do nothing if their is either no connection or no motor connected to port
-            if ~motor.connectedToBrick || ~motor.physicalMotorConnected
+            % Do nothing if there is either no connection or no motor connected to port
+            if ~motor.ev3Handle.isConnected || ~motor.physicalMotorConnected
                 return; 
             end
             
diff --git a/source/OutputStreamSend.class b/source/OutputStreamSend.class
deleted file mode 100755
index 50aa9f9f6fe5e3e3ad9d43e454f3d4da298ef3bb..0000000000000000000000000000000000000000
Binary files a/source/OutputStreamSend.class and /dev/null differ
diff --git a/source/OutputStreamSend.java b/source/OutputStreamSend.java
deleted file mode 100755
index 2249b5dee071d7dd4100d60e899e398121247fe3..0000000000000000000000000000000000000000
--- a/source/OutputStreamSend.java
+++ /dev/null
@@ -1,53 +0,0 @@
-import java.io.*;
-
-public class OutputStreamSend {
-  public static byte[] buffer = null;
-  public static int counter = 0;
-
-  public OutputStreamSend(int length) {
-    buffer = new byte[length];
-    clear();
-  }
-
-  public OutputStreamSend() {
-    this(128);
-  }
-  
-  public void addtoBuffer(char v) {
-      buffer[counter] = (byte)v;
-      counter++;
-  }
-  
-  public void addtoBufferN(char[] v, int len) {
-        for(int i=0; i<len; i++)
-        {
-            buffer[counter] = (byte)v[i];
-            counter++;
-        }
-  }
-  
-  public void display() {
-      for(int i=0;i<counter;i++)
-      {
-        System.out.print(buffer[i]);
-      }
-  }
-  
-  public void clear() {
-       for(int i=0;i<counter;i++)
-      {
-        buffer[i] = 0;
-      }
-      counter = 0;
-  }
-
-  public void send(OutputStream output) throws IOException {
-      try {
-        output.write(buffer,0,counter);
-		output.flush();
-        this.clear();
-            
-      } catch (Exception e) {}
-  }
-
-}
diff --git a/source/Sensor.m b/source/Sensor.m
old mode 100755
new mode 100644
index 360a06e441cd0280af6016960625d42a1882b156..a7300c21c8fb501124b2407c7fdf09a30ad42f91
--- a/source/Sensor.m
+++ b/source/Sensor.m
@@ -1,4 +1,4 @@
-classdef Sensor < MaskedHandle
+classdef Sensor < MaskedHandle      
     % High-level class to work with sensors.
     % 
     % The Sensor-class facilitates the communication with sensors. This mainly consists of 
@@ -8,14 +8,13 @@ classdef Sensor < MaskedHandle
     %     * You don't need to create instances of this class. The EV3-class automatically creates
     %       instances for each sensor port, and you can work with them via the EV3-object. 
     %     * The Sensor-class represents sensor ports, not individual sensors!
-    %
+    %     * When an input argument of a method is marked as optional, the argument needs to be 
+    %       'announced' by a preceding 2nd argument, which is a string containing the name of the argument. 
+    %       For example, Motor.setProperties may be given a power-parameter. The syntax would be as
+    %       follows: *brickObject.motorA.setProperties('power', 50);*
     %
     % Attributes:
-    %    mode (DeviceMode.{Type}): Sensor mode in which the value will be read. By default, 
-    %        mode is set to DeviceMode.Default.Undefined. Once a physical sensor is connected
-    %        to the port *and* the physical Brick is connected to the EV3-object, the allowed 
-    %        mode and the default mode for a Sensor-object are the following (depending on the
-    %        sensor type): *[WRITABLE]*
+    %    mode (DeviceMode.{Type}): Sensor mode in which the value will be read. By default, mode is set to *DeviceMode.Default.Undefined*. See also :attr:`type`. *[WRITABLE]* |br| Once a physical sensor is connected to the port *and* the physical Brick is connected to the EV3-object, the allowed mode and the default mode for a Sensor-object are the following (depending on the sensor type): 
     %
     %             * Touch-Sensor: 
     %                 * DeviceMode.Touch.Pushed *[Default]*
@@ -75,7 +74,7 @@ classdef Sensor < MaskedHandle
     %        the sublayer ('communication layer'), there is feedback in the console about what 
     %        command has been called. *[WRITABLE]*
     %    value (numeric): Value read from hysical sensor. What the value represents depends on
-    %        sensor.mode. *[READ-ONLY]*
+    %        :attr:`mode`. *[READ-ONLY]*
     %    type (DeviceType): Type of physical sensor connected to the port. Possible types are: [READ-ONLY]
     %
     %             * DeviceType.NXTTouch
@@ -199,9 +198,8 @@ classdef Sensor < MaskedHandle
     end
 
     properties (Hidden, Access = private)  % Hidden properties for internal use only 
-        % commInterface (CommunicationInterface): Commands are created and sent via the 
-        %     communication interface class.
-        commInterface; 
+        % ev3Handle (EV3): Handle to the EV3-object to which this sensor instance belongs
+        ev3Handle;
         
         % port (string): Sensor port. 
         %     This is only the string representation of the sensor port to work with.
@@ -210,9 +208,6 @@ classdef Sensor < MaskedHandle
         
         % init (bool): Indicates init-phase (i.e. constructor is running).
         init = true;
-        
-        % connectedToBrick (bool): True if virtual brick is connected to physical brick.
-        connectedToBrick = false;
     end   
     
     properties (Hidden, Dependent, Access = private)
@@ -238,25 +233,13 @@ classdef Sensor < MaskedHandle
         
         %% Brick functions
         function reset(sensor)
-            % Resets value on sensor
+            % Resets sensor value.
+            %
+            % Notes:
+            %     * Has not been thoroughly tested but seems to work as expected
             %
-			% Notes:
-            %     * This clears ALL the sensors right now, no other Op-Code available... :(
-            if ~sensor.connectedToBrick
-                error('Sensor::reset: Sensor-Object not connected to comm handle.');
-            elseif ~sensor.physicalSensorConnected
-                error('Sensor::reset: No physical sensor connected to Port %d.',...
-                       sensor.port+1);
-            end
-            
-%             warning(['Sensor::reset: Current version of reset resets ALL devices, that is, ',...
-%                      'all motor tacho counts and all other sensor counters!']);
-            sensor.commInterface.inputDeviceClrAll(0);
             
-            if sensor.debug
-                fprintf('(DEBUG) Sensor::reset: Called inputReadSI on Port %d.\n',...
-                    sensor.port+1);
-            end
+            sensor.handleCommand(@inputDeviceClrChanges, false, 0, sensor.port);
         end
         
         %% Setter
@@ -268,16 +251,15 @@ classdef Sensor < MaskedHandle
             
             type = sensor.type;
             if ~isModeValid(mode, type)
-                error('Sensor::set.mode: Invalid sensor mode.');
-            else
-                sensor.mode = mode;
-                
-                if ~strcmp(class(mode),'DeviceMode.Default') && sensor.connectedToBrick 
-                    try
-                        sensor.setMode(mode);  % Update physical brick's mode parameter
-                    catch
-                        % Ignore
-                    end
+                error('Invalid sensor mode.');
+            end
+            
+            sensor.mode = mode;
+            if ~strcmp(class(mode),'DeviceMode.Default') && sensor.ev3Handle.isConnected 
+                try
+                    sensor.setMode(mode);  % Update physical brick's mode parameter
+                catch
+                    % Ignore
                 end
             end
         end
@@ -285,7 +267,7 @@ classdef Sensor < MaskedHandle
         function set.debug(sensor, debug)
             % Check if debug is valid and set sensor.debug if it is.
             if ~isBool(debug)
-                error('Sensor::set.debug: Given parameter is not a bool.');
+                error('Given parameter is not a bool.');
             end
             
             sensor.debug = str2bool(debug);
@@ -293,31 +275,23 @@ classdef Sensor < MaskedHandle
         
         function set.port(sensor, port)
             if ~isPortStrValid(class(sensor),port)
-                error('Sensor::set.port: Given port is not a valid port.');
-            else
-                sensor.port = str2PortParam(class(sensor), port);
-            end
-        end
-        
-        function set.commInterface(sensor, comm)
-            if ~isCommInterfaceValid(comm)
-                error('Sensor::set.commInterface: Handle to commInterface not valid.');
-            else
-                sensor.commInterface = comm;
+                error('Given port is not a valid port.');
             end
+            
+            sensor.port = str2PortParam(class(sensor), port);
         end
         
         function setProperties(sensor, varargin)
             % Sets multiple Sensor properties at once using MATLAB's inputParser.
             %
             % Arguments:
-            %     debug (bool) *[OPTIONAL]*
-            %     mode (DeviceMode.{Type}) *[OPTIONAL]*
+            %     debug (bool): *[OPTIONAL]*
+            %     mode (DeviceMode.{Type}): *[OPTIONAL]*
             %
             % Example:
-            %     b = EV3(); |br|
-            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); |br|
-            %     b.sensor1.setProperties('debug', 'on', 'mode', DeviceMode.Color.Ambient); |br|
+            %     b = EV3(); % |br|
+            %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
+            %     b.sensor1.setProperties('debug', 'on', 'mode', DeviceMode.Color.Ambient); % |br|
             %     % Instead of: b.sensor1.debug = 'on'; |br|
             %     %             b.sensor1.mode = DeviceMode.Color.Ambient; |br|
             %
@@ -335,6 +309,7 @@ classdef Sensor < MaskedHandle
             % Add parameter
             if sensor.init
                 p.addRequired('port');
+                p.addRequired('ev3Handle');
             end
             p.addOptional('debug', defaultDebug);
             p.addOptional('mode', defaultMode);
@@ -345,6 +320,7 @@ classdef Sensor < MaskedHandle
             % Set properties
             if sensor.init
                 sensor.port = p.Results.port;
+                sensor.ev3Handle = p.Results.ev3Handle;
             end
             sensor.mode = p.Results.mode;
             sensor.debug = p.Results.debug;
@@ -353,12 +329,11 @@ classdef Sensor < MaskedHandle
         %% Getter
         function value = get.value(sensor)
             value = 0;
-            defaultMode = -1;
             
-            if sensor.connectedToBrick
-                value = sensor.getValue(defaultMode);
+            if sensor.ev3Handle.isConnected
+                value = sensor.getValue();
                 if isnan(value)
-                    warning('Sensor::get.value: Could not detect sensor at port %d.', ...
+                    warning('Could not detect sensor at port %d.', ...
                         sensor.port+1);
                     value = 0;
                 end
@@ -372,7 +347,7 @@ classdef Sensor < MaskedHandle
         end
         
         function sensorType = get.type(sensor)
-            if sensor.connectedToBrick
+            if sensor.ev3Handle.isConnected
                 [sensorType, ~] = sensor.getTypeMode(); 
             else
                 sensorType = DeviceType.Unknown;
@@ -387,50 +362,17 @@ classdef Sensor < MaskedHandle
     
     methods (Access = private)  % Private brick functions that are wrapped by dependent params
         function setMode(sensor, mode)
-            if ~sensor.connectedToBrick
-                error('Sensor::getTachoCount: Sensor-Object not connected to comm handle.');
-            elseif ~sensor.physicalSensorConnected
-                error('Sensor::getTachoCount: No physical sensor connected to Port %d',...
-                       sensor.port+1);
-            end
-            
-            sensor.commInterface.inputReadSI(0, sensor.port, mode);  % Reading a value implicitly
-                                                             % sets the mode.
-            
-            if sensor.debug
-                fprintf('(DEBUG) Sensor::setMode: Called inputReadSI on Port %d.\n',...
-                    sensor.port+1);
-            end
+            sensor.handleCommand(@inputReadSI, true, 0, sensor.port, mode);  % Reading a value implicitly sets the mode.
         end
         
-        function val = getValue(sensor, varargin)
+        function val = getValue(sensor)
             %getValue Reads value from sensor
             % 
             % Notes:
             %  * After changing the mode, sensors initially always send an invalid value. In
             %    this case, the inputReadSI-opCode is sent again to get the correct value.
             %
-            
-            if ~isempty(varargin)
-                defaultMode = varargin{1};
-                
-                % 5 is numerically highest available number of modes for a sensor(NXT Color)
-                if ~isnumeric(defaultMode) || defaultMode > 5
-                     error('Sensor::getValue: Invalid mode');
-                end
-            else
-                defaultMode = -1;
-            end
-            
-            if ~sensor.connectedToBrick
-                error('Sensor::getValue: Sensor-Object not connected to comm handle.');
-            end
-            
-            if defaultMode ~= -1
-                val = sensor.commInterface.inputReadSI(0, sensor.port, defaultMode);
-            else
-                val = sensor.commInterface.inputReadSI(0, sensor.port, sensor.mode);
-            end
+            val = sensor.handleCommand(@inputReadSI, false, 0, sensor.port, sensor.mode);
             
             if strcmp(class(sensor.mode), 'DeviceMode.Color')
                 if sensor.mode == DeviceMode.Color.Col
@@ -440,46 +382,28 @@ classdef Sensor < MaskedHandle
             
             % See note
 			if isnan(val)
-				val = sensor.commInterface.inputReadSI(0, sensor.port, sensor.mode);
-                if sensor.debug
-                    fprintf('(DEBUG) Sensor::getValue: Called inputReadSI on Port %d.\n',...
-                        sensor.port+1);
-                end
-			end
-			
-            if sensor.debug
-                fprintf('(DEBUG) Sensor::getValue: Called inputReadSI on Port %d.\n',...
-                    sensor.port+1);
+				val = sensor.handleCommand(@inputReadSI, false, 0, sensor.port, sensor.mode);
             end
         end
         
         function status = getStatus(sensor)
-           if ~sensor.connectedToBrick
-                error('Sensor::getStatus: Sensor-Object not connected to comm handle.');
-           end
-           
-            statusNo = sensor.commInterface.inputDeviceGetConnection(0, sensor.port);
-            status = ConnectionType(statusNo);
-            
-            if sensor.debug
-                fprintf(['(DEBUG) Sensor::getStatus: Called inputDeviceGetConnection on ' ,...
-                         'Port %d.\n'], sensor.port+1);
-            end
+           statusNo = sensor.handleCommand(@inputDeviceGetConnection, false, 0, sensor.port);
+           status = ConnectionType(statusNo);
         end
         
         function [type,mode] = getTypeMode(sensor)
-           if ~sensor.connectedToBrick
-                error('Sensor::getTypeMode: Sensor-Object not connected to comm handle.');
-           end
-           
             type = DeviceType.Error;
+            
+            % In very rare cases, the brick sends an invalid type-no - try to get a valid one up
+            % to ten times (I know, I know, another ugly workaround :( )
             for i = 1:10
                 try
-                    [typeNo,modeNo] = sensor.commInterface.inputDeviceGetTypeMode(0, sensor.port);
+                    [typeNo,modeNo] = sensor.handleCommand(@inputDeviceGetTypeMode, false, 0, sensor.port);
                     type = DeviceType(typeNo);
                 catch ME
                     continue;
                 end
+                
                 break;
             end
                 
@@ -488,51 +412,47 @@ classdef Sensor < MaskedHandle
             catch ME
                 mode = DeviceMode.Default.Undefined;
             end
-            
-            if sensor.debug
-                fprintf(['(DEBUG) Sensor::getStatus: Called inputDeviceGetConnection on ' ,...
-                         'Port %d.\n'], sensor.port+1);
-            end
         end
         
-    end
-    
-    methods (Access = ?EV3)
-        function connect(sensor,commInterface)
-            %connect Connects Sensor-object to physical brick
+        function varargout = handleCommand(sensor, command, checkDevice, varargin)
+            % Execute a CommunicationInterface-method given as a handle
+            %
+            % As those methods have different, fixed numbers of output arguments, this quantity
+            % has to be retrieved first.
             
-            if sensor.connectedToBrick
-                if isCommInterfaceValid(sensor.commInterface)
-                    error('Sensor::connect: Sensor-Object already has a comm handle.');
-                else
-                    warning(['Sensor::connect: Sensor.connectedToBrick is set to ''True'', but ',...
-                        'comm handle is invalid. Deleting invalid handle and ' ,...
-                        'resetting Sensor.connectedToBrick now...']);
-                    
-                    sensor.commInterface = 0;
-                    sensor.connectedToBrick = false;
-                    
-                    error('Sensor::connect: Disconnected due to internal error.');
-                end
+            if ~sensor.ev3Handle.isConnected
+                msg = ['Not connected to physical brick. ',...
+                       'You have to call connect(...) on the EV3 object first!'];
+                id = [ID(), ':', 'NotConnected'];
+                
+                throw(MException(id, msg));
+            elseif checkDevice && ~sensor.physicalSensorConnected
+                msg = ['Could not detect sensor at port %d', sensor.port+1, '.'];
+                id = [ID(), ':', 'NoDevice'];
+                
+                throw(MException(id, msg));
             end
             
-            sensor.commInterface = commInterface;
-            sensor.connectedToBrick = true;
-            
             if sensor.debug
-                fprintf('(DEBUG) Sensor-Object connected to comm handle.\n');
+                fprintf('(DEBUG) Sending %s\n', func2str(command));
             end
-        end
-        
-        function disconnect(sensor)
-            %disconnect Disconnects Sensor-object from physical brick
             
-            sensor.commInterface = 0; % Note: actual deleting is done in EV3::disconnect.
-            sensor.connectedToBrick = false;
-        end
-        
+            % Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
+            % do this ugly workaround using strings. See 
+            % https://de.mathworks.com/matlabcentral/answers/96617-how-can-i-use-nargin-nargout-to-determine-the-number-of-input-output-arguments-of-an-object-method
+            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(command)));
+            [varargout{1:nOut}] = sensor.ev3Handle.dispatch(command, nOut, varargin{:});
+        end 
+    end
+    
+    methods (Access = ?EV3)
         function resetPhysicalSensor(sensor)
-            if ~sensor.connectedToBrick || ~sensor.physicalSensorConnected
+            % Reset mode to default and reset sensor value
+            %
+            % Notes: 
+            %     * This is called automatically on disconnect
+            
+            if ~sensor.ev3Handle.isConnected || ~sensor.physicalSensorConnected
                 return
             end
             
diff --git a/source/btBrickIO.m b/source/btBrickIO.m
old mode 100755
new mode 100644
index 02946f677e153d650af1a0195670a0e426e59df0..2e955475bd2a1a8ecc715a88dd20fb099672578d
--- a/source/btBrickIO.m
+++ b/source/btBrickIO.m
@@ -1,225 +1,308 @@
-%btBrickIO Bluetooth interface between MATLAB and the brick
-%
-% Methods::
-%
-%  btBrickIO    Constructor, initialises and opens the bluetooth connection
-%  delete       Destructor, closes the bluetooth connection
-%
-%  open         Open a bluetooth connection to the brick
-%  close        Close the bluetooth connection to the brick
-%  read         Read data from the brick through bluetooth
-%  write        Write data to the brick through bluetooth
-%
-% Example::
-%           btbrick = btBrickIO(1,'/dev/rfcomm0')
-%
-% Notes::
-% - Connects to the bluetooth module on the host through a serial
-% connection. Hence be sure that a serial connection to the bluetooth
-% module can be made. Also be sure that the bluetooth module can be paired
-% to the brick before MATLAB is opened.
-% - Works under mac and potentially linux (have yet to find a suitable
-% bluetooth device that can pair with the brick under linux).
-% - Does not work under windows (will need to either virtualise the serial
-% bluetooth port or use the instrumentation and control toolbox BrickIO
-% version).
-
-classdef btBrickIO < BrickIO
-    properties
-        % debug input
-        debug = 0;
-        % bluetooth serial port
-        serialPort = '/dev/rfcomm0'
-    end
-    
-    properties (Access = 'protected')
-        % connection handle
-        handle
-    end 
-    
-    methods
-        function brickIO = btBrickIO(debug,serialPort)
-            %btBrickIO.btBrickIO Create a btBrickIO object
-            %
-            % btbrick = btBrickIO(debug,serialPort) is an object which
-            % initialises and opens a bluetooth connection between MATLAB
-            % and the brick using serial functions.
-            %
-            % Notes::
-            % - debug is a flag specifying output printing (0 or 1).
-            
-            if nargin > 1
-                brickIO.debug = debug;
-                brickIO.serialPort = serialPort;
-            end
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO init\n');
-            end
-            
-            % Set the connection handle
-            try
-                brickIO.handle = serial(brickIO.serialPort);
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'invalidPORT'))
-                    % Throw a clean InvalidSerialPort to avoid confusion in upper layers
-                    msg = 'Couldn''t connect to BT-device because given serial port is invalid.';
-                    id = [ID(), ':', 'InvalidSerialPort'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while creating serial-port-object for BT connection.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-            
-            % Open the connection handle
-            brickIO.open;
-        end
-        
-        function delete(brickIO)
-            %btBrickIO.delete Delete the btBrickIO object
-            %
-            % delete(brickIO) closes the bluetooth connection handle
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO delete\n');
-            end
-            
-            % Disconnect
-            try
-                brickIO.close;
-            catch
-                % Connection already closed (probably due to an error) - do nothing
-            end
-        end
-        
-        function open(brickIO)
-            %btBrickIO.open Open the btBrickIO object
-            %
-            % btBrickIO.open() opens the bluetooth connection to the brick
-            % using fopen.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO open\n');
-            end
-            
-            % Open the bt handle
-            try
-                fopen(brickIO.handle);
-            catch ME 
-                if strcmp(ME.identifier, 'MATLAB:serial:fopen:opfailed')
-                    % Throw only clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to open connection to Brick via Bluetooth.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to communication
-                    % failure
-                    msg = 'Unknown error occurred while connecting to the Brick via Bluetooth.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-
-        function close(brickIO)
-            %btBrickIO.close Close the btBrickIO object
-            %
-            % btBrickIO.close() closes the bluetooth connection the brick
-            % using fclose.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO close\n');
-            end 
-            
-            try
-                % Close the close handle
-                fclose(brickIO.handle);
-            catch ME
-                % Throw combined error because error did not happen due to communication
-                % failure
-                msg = 'Unknown error occurred while disconnecting from the Brick via Bluetooth.';
-                id = [ID(), ':', 'UnknownError'];
-                newException = MException(id, msg);
-                newException = addCause(newException, ME);
-                throw(newException);
-            end
-        end
-        
-        function rmsg = read(brickIO)
-            %btBrickIO.read Read data from the btBrickIO object
-            %
-            % rmsg = btBrickIO.read() reads data from the brick through
-            % bluetooth via fread and returns the data in uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO read\n');
-            end 
-            
-            try
-                % Get the number of bytes to be read from the bt handle
-                nLength = fread(brickIO.handle,2);
-
-                % Read the remaining bytes
-                rmsg = fread(brickIO.handle,double(typecast(uint8(nLength),'uint16')));
-            catch ME
-                if strcmp(ME.identifier, 'MATLAB:serial:fread:opfailed')
-                    % Throw only clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to read data from Brick via Bluetooth.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while reading data from the Brick via BT.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-            
-            % Append the reply size to the return message
-            rmsg = uint8([nLength' rmsg']);
-        end
-        
-        function write(brickIO,wmsg)
-            %btBrickIO.write Write data to the btBrickIO object
-            %
-            % btBrickIO.write(wmsg) writes data to the brick through
-            % bluetooth.
-            %
-            % Notes::
-            % - wmsg is the data to be written to the brick via bluetooth
-            % in uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO write\n');
-            end 
-            
-            try
-                % Write to the bluetooth handle
-                fwrite(brickIO.handle,wmsg);
-            catch ME
-                if strcmp(ME.identifier, 'MATLAB:serial:fwrite:opfailed')
-                    % Throw only clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to send data to Brick via Bluetooth.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while sending data to the Brick via BT.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-    end 
-end
+classdef btBrickIO < BrickIO      
+    % Bluetooth interface between MATLAB and the brick
+    %
+    % Notes:
+    %     * Connects to the bluetooth module on the host through a serial
+    %       connection. Hence be sure that a serial connection to the bluetooth
+    %       module can be made. Also be sure that the bluetooth module has been paired
+    %       to the brick before trying to connect.
+    %     * Usage is OS-dependent:
+    %           * Windows: the deviceName- & channel-properties are needed for connection. The implementation is based on the Instrument Control toolbox.
+    %           * Linux (and potentially Mac): serialPort-property is needed for connection. The implementation is based on MATLAB's serial port implementation.
+    %
+    %     * For general information, see also :class:`BrickIO`.
+    %
+    % Attributes:
+    %     debug (bool): If true, each open/close/read/write-call will be shown in the console.
+    %        Defaults to false.
+    %     serialPort (string): Path to the serial-port object. Only needed when using MATLAB's 
+    %        serial class (i.e. on linux/mac). Defaults to '/dev/rfcomm0'.
+    %     deviceName (string):  Name of the BT-device = the brick. Only needed when using the 
+    %        Instrument Control toolbox (i.e. on windows). Defaults to 'EV3'.
+    %     channel (numeric > 0): BT-channel of the connected BT-device. Only needed when using 
+    %        the Instrument Control toolbox (i.e. on windows). Defaults to 1.
+    %     timeOut (numeric >= 0): seconds after which a timeout-error occurs if no packet could be
+    %        read. Defaults to 10.
+    %     backend ('serial'|'instrumentControl'): Backend this implementation is based on. Is
+    %        automatically chosen depending on the OS. Defaults to 'serial' on linux/mac
+    %        systems, and to 'instrumentControl' on windows systems.
+    %
+    % 
+    % Examples:
+    %     % Connecting on windows |br|
+    %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1); % |br| 
+    %     % Connecting on windows using MATLABs default serial port implementation for testing |br|
+    %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1, 'backend', 'serial'); % |br|
+    %     % Connecting on mac/linux |br|
+    %     commHandle = btBrickIO('serPort', '/dev/rfcomm0'); % |br| 
+    %
+    
+    properties
+        % debug (bool): If true, each open/close/read/write-call will be noted in the console.
+        %     Defaults to false.
+        debug;
+        % serialPort (string): Path to the serial-port object. Defaults to '/dev/rfcomm0'.
+        %     Only needed when using MATLAB's serial class (i.e. on linux/mac). 
+        serialPort;
+        % deviceName (string):  Name of the BT-device = the brick. Defaults to 'EV3'.
+        %     Only needed when using the Instrument Control toolbox (i.e. on windows). 
+        deviceName;
+        % channel (numeric > 0): BT-channel of the connected BT-device. Defaults to 1.
+        %     Only needed when using the Instrument Control toolbox (i.e. on windows). 
+        channel;
+        % timeOut (numeric > 0): Seconds after which a timeout-error occurs if no packet could be read. 
+        %     Defaults to 10.
+        timeOut;
+        % backend ('serial'|'instrumentControl'): Backend this implementation is based on. 
+        %     Is automatically chosen depending on the OS. Defaults to 'serial' on linux/mac
+        %     systems, and to 'instrumentControl' on windows systems.
+        backend;
+    end
+    
+    properties (Access = protected)
+        % handle: Connection handle to the device
+        handle;
+    end 
+    
+    methods
+        function brickIO = btBrickIO(varargin)
+            % Create a btBrickIO object
+            %
+            % Arguments:
+            %     varargin: Any number of property names as strings, each followed by the
+            %         desired value. 
+            % 
+            % Examples: 
+            %     % Connecting on windows
+            %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1); 
+            %     % Connecting on windows using MATLABs default serial port implementation for testing
+            %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1, 'backend', 'serial'); 
+            %     % Connecting on mac/linux 
+            %     commHandle = btBrickIO('serPort', '/dev/rfcomm0');
+            %
+            % See also BTBRICKIO.SETPROPERTIES
+            
+            brickIO.setProperties(varargin{:});
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (BT init) \n');
+            end
+            
+            % Set the connection handle
+            try
+                if strcmp(brickIO.backend, 'serial')
+                   brickIO.handle = serial(brickIO.serialPort);
+                else
+                   brickIO.handle = Bluetooth(brickIO.deviceName,brickIO.channel);
+                end
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'invalidPORT'))
+                    % Throw a clean InvalidSerialPort to avoid confusion in upper layers
+                    msg = 'Couldn''t connect to BT-device because given serial port is invalid.';
+                    id = [ID(), ':', 'InvalidSerialPort'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while creating serial-port-object for BT connection.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+            
+            % Open the connection
+            brickIO.open;
+        end
+        
+        function delete(brickIO)
+            % Delete the btBrickIO object and closes the connection
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (BT delete) \n');
+            end
+            
+            % Disconnect
+            try
+                brickIO.close;
+            catch
+                % Connection already closed (probably due to an error) - do nothing
+            end
+        end
+        
+        function open(brickIO)
+            % Opens the bluetooth connection to the brick using fopen.
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (BT open)\n');
+            end
+            
+            % Open the bt handle
+            try
+                fopen(brickIO.handle);
+            catch ME 
+                if strcmp(ME.identifier, 'MATLAB:serial:fopen:opfailed')
+                    % Throw only clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to open connection to Brick via Bluetooth.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to communication
+                    % failure
+                    msg = 'Unknown error occurred while connecting to the Brick via Bluetooth.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+
+        function close(brickIO)
+            % Closes the bluetooth connection the brick using fclose.
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (BT close) \n');
+            end 
+            
+            try
+                % Close the close handle
+                fclose(brickIO.handle);
+            catch ME
+                % Throw combined error because error did not happen due to communication
+                % failure
+                msg = 'Unknown error occurred while disconnecting from the Brick via Bluetooth.';
+                id = [ID(), ':', 'UnknownError'];
+                newException = MException(id, msg);
+                newException = addCause(newException, ME);
+                throw(newException);
+            end
+        end
+        
+        function rmsg = read(brickIO)
+            % Reads data from the brick through bluetooth via fread and returns the data in uint8 format.
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (BT read) \n');
+            end 
+            
+            try
+                % Get the number of bytes to be read from the bt handle
+                nLength = fread(brickIO.handle,2);
+
+                % Read the remaining bytes
+                rmsg = fread(brickIO.handle,double(typecast(uint8(nLength),'uint16')));
+            catch ME
+                if strcmp(ME.identifier, 'MATLAB:serial:fread:opfailed')
+                    % Throw only clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to read data from Brick via Bluetooth.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while reading data from the Brick via BT.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+            
+            % Append the reply size to the return message
+            rmsg = uint8([nLength' rmsg']);
+        end
+        
+        function write(brickIO,wmsg)
+            % Writes data to the brick through bluetooth via fwrite.
+            %
+            % Arguments:
+            %     wmsg (uint8 array): Data to be written to the brick via bluetooth
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (BT write) \n');
+            end 
+            
+            try
+                % Write to the bluetooth handle
+                fwrite(brickIO.handle,wmsg);
+            catch ME
+                if strcmp(ME.identifier, 'MATLAB:serial:fwrite:opfailed')
+                    % Throw only clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to send data to Brick via Bluetooth.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while sending data to the Brick via BT.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+        
+        function set.timeOut(brickIO, timeOut)
+            if ~isnumeric(timeOut) || timeOut < 0
+                error(ID(), 'timeOut-period of Bluetooth-handle can only be set to positive numerical values.'); 
+            end
+            
+            brickIO.timeOut = timeOut;
+            
+            if timeOut == 0
+               brickIO.handle.Timeout = 9999999; % MATLAB.serial seems to have no option to disable timeout
+            end
+        end
+        function set.backend(brickIO, backend)
+            if ~strcmp(backend, 'serial')
+                if ~strcmp(backend, 'instrumentControl')
+                    msg = 'btBrickIO''s backend-parameter has to be either ''serial'' or ''instrumentControl''.';
+                    id = [ID(), ':', 'InvalidParameter'];
+                    throw(MException(id, msg));
+                elseif ~license('test', 'instr_control_toolbox')
+                    msg = 'Cannot use Instrument-Control-Toolbox for Bluetooth: Toolbox not installed.';
+                    id = [ID(), ':', 'AssetNotAvailable'];
+                    throw(MException(id, msg));
+                end
+            end
+            
+            brickIO.backend = backend;
+        end
+        function setProperties(brickIO, varargin)
+            % Sets multiple btBrickIO properties at once using MATLAB's inputParser.
+            %
+            % The syntax is as follows: commHandle.setProperties('propertyName1',
+            % propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+            % are: debug, serPort, deviceName, channel, timeout.
+            %
+            % See also BTBRICKIO.DEBUG, BTBRICKIO.SERIALPORT, BTBRICKIO.DEVICENAME,
+            % BTBRICKIO.CHANNEL, BTBRICKIO.TIMEOUT
+            
+            p = inputParser();
+            p.KeepUnmatched = 1;
+            
+            p.addOptional('debug', false);
+            p.addOptional('serPort', '/dev/rfcomm0');
+            p.addOptional('deviceName', 'EV3');
+            p.addOptional('channel', 1);
+            p.addOptional('timeOut', 10);
+            if(ispc && license('test', 'instr_control_toolbox'))  % Choose 'backend'-default depending on OS
+                p.addOptional('backend', 'instrumentControl');
+            else
+                if ispc
+                    warning('Instrument&Control-Toolbox not installed. Using MATLAB default backend for BT communication. This could lead to errors on Windows!'); 
+                end
+                p.addOptional('backend', 'serial');
+            end
+            
+            p.parse(varargin{:});
+            
+            brickIO.debug = p.Results.debug;
+            brickIO.serialPort = p.Results.serPort;
+            brickIO.deviceName = p.Results.deviceName;
+            brickIO.channel = p.Results.channel;
+            brickIO.timeOut = p.Results.timeOut;
+            brickIO.backend = p.Results.backend;
+        end
+    end 
+end
diff --git a/source/displayProperties.m b/source/displayProperties.m
index 7b39943844cc380e259cf5628f5a6a0c5ee37ba4..3c7a8effc06ea6405ae93749063f30a77b89f940 100644
--- a/source/displayProperties.m
+++ b/source/displayProperties.m
@@ -46,15 +46,15 @@ for i = 1:length(dependentProps)
     value = device.(p);
     if ~isempty(enumeration(value))  % Test if parameter is enumeration
         fprintf('\t%15s:   %s\n', p, char(value));
-    elseif isnumeric(device.(p)) || islogical(value)
+    elseif isnumeric(value) || islogical(value)
         if isfloat(value)
             fprintf('\t%15s:   %1.1f\n', p, value);
         else
             fprintf('\t%15s:   %d\n', p, value);
         end
-    elseif ischar(device.(p))
+    elseif ischar(value)
         fprintf('\t%15s:   %s\n', p, value);
-    elseif islogical(device.(p))
+    elseif islogical(value)
 
     end
 end
diff --git a/source/hidapi.m b/source/hidapi.m
old mode 100755
new mode 100644
index 014c4a15bd580b3e4ae956fbc1c9c32919832593..a9f17b2af7d36a8e4c0797a9bb69034280dc9e50
--- a/source/hidapi.m
+++ b/source/hidapi.m
@@ -1,539 +1,497 @@
-%hidpi Interface to the hidapi library
-%
-% Methods::
-%  hidapi                   Constructor, loads the hidapi library
-%  delete                   Destructor, closes any open hid connection
-%
-%  open                     Open the hid device with vendor and product ID
-%  close                    Close the hid device connection
-%  read                     Read data from the hid device
-%  write                    Write data to the hid device
-%
-%  getHIDInfoString         Get the relevant hid info from the hid device
-%  getManufacturersString   Get the manufacturers string from the hid device
-%  getProductString         Get the product string from the hid device
-%  getSerialNumberString    Get the serial number from the hid device
-%  setNonBlocking           Set non blocking hid read
-%  init                     Init the hidapi (executed in open by default)
-%  exit                     Exit the hidapi
-%  error                    Return the error string
-%  enumerate                Enumerate the connected hid devices
-%
-%
-% Example::
-%           hid = hidapi(1,1684,0005,1024,1025)
-%
-% Notes::
-% - Developed from the hidapi available from http://www.signal11.us/oss/hidapi/
-% - Windows: need the hidapi.dll file
-% - Mac: need the hidapi.dylib file. Will also need Xcode installed to run load library
-% - Linux: will need to compile on host system and copy the resulting .so file
-
-classdef hidapi < handle
-    properties
-        % connection handle
-        handle
-        % debug input
-        debug = 0;
-        % vendor ID
-        vendorID = 0;
-        % product ID
-        productID = 0;
-        % read buffer size
-        nReadBuffer = 256;
-        % write buffer size
-        nWriteBuffer = 256;
-        % shared library
-        slib = 'hidapi';
-        % shared library header
-        sheader = 'hidapi.h';
-        
-    end
-    
-    methods
-        %% Constructor
-        
-        function hid = hidapi(debug,vendorID,productID,nReadBuffer,nWriteBuffer)
-            %hidapi.hidapi Create a hidapi library interface object
-            %
-            % hid = hidapi(debug,vendorID,productID,nReadBuffer,nWriteButter)
-            % is an object which initialises the hidapi from the corresponding
-            % OS library. Other parameters are also initialised. Some OS
-            % checking is required in this function to load the correct
-            % library.
-            %
-            % Throws::
-            %  LoadingLibraryError              Could not load .dll/.dylib/.so-file of hidapi
-            %  InvalidFileNameOrFileMissing     Either file names given were wrong or the files 
-            %                                   are missing (thunk files, proto files, ...)
-            %
-            % Notes::
-            % - debug is a flag specifying output printing (0 or 1).
-            % - vendorID is the vendor ID of the hid device (decimal not hex).
-            % - productID is the product ID of the hid device (decimal not hex).
-            % - nReadBuffer is the length of the read buffer.
-            % - nWriteBuffer is the length of the write buffer.
-            
-            
-            hid.debug = debug;
-            
-            if hid.debug > 0
-                fprintf('hidapi init\n');
-            end
-            
-            if nargin > 1
-                hid.vendorID = vendorID;
-                hid.productID = productID;
-                hid.nReadBuffer = nReadBuffer;
-                hid.nWriteBuffer = nWriteBuffer;
-            end
-            
-            % Disable warnings
-            warning('off','MATLAB:loadlibrary:TypeNotFoundForStructure');
-            warning('off', 'MATLAB:loadlibrary:ClassIsLoaded');
-            
-            try
-                % Check the operating system type and load slib
-                if (ispc == 1)
-                    % Check the bit version
-                    if (strcmp(mexext,'mexw32'))
-                        hid.slib = 'hidapi32';
-                        % Load the library via the proto file
-                        loadlibrary(hid.slib,@hidapi32_proto,'alias','hidapiusb')
-                    elseif (strcmp(mexext,'mexw64'))
-                        hid.slib = 'hidapi64';
-                        % Load the library via the proto file
-                        loadlibrary(hid.slib,@hidapi64_proto,'alias','hidapiusb')
-                    end
-                elseif (ismac == 1)
-                    hid.slib = 'hidapi64';
-                    % Load the library via the proto file
-                    loadlibrary(hid.slib,@hidapi64mac_proto,'alias','hidapiusb');
-                elseif (isunix == 1)
-                    hid.slib = 'libhidapi-libusb';
-                    % Load the shared library
-                    loadlibrary(hid.slib,@hidapi_libusb_proto,'alias','hidapiusb');
-                end
-            catch ME
-                % Create own exception for clarification
-                id = [ID(), ':', 'LoadingLibraryError'];
-                msg = strcat({'Could not load library '}, {hid.slib}, {'.'});
-                exception = MException(id, msg);
-
-                % Try to narrow down loading failure
-                if isempty(findstr(ME.identifier, 'LoadFailed')) ...
-                        && isempty(findstr(ME.identifier, 'ErrorLoadingLibrary')) ...
-                        && isempty(findstr(ME.identifier, 'ErrorInHeader'))
-                    id = [ID(), ':', 'InvalidFileNameOrFileMissing'];
-                    msg = 'Invalid file names were given or files are not available.';
-                    cause = MException(id, msg);
-                    exception = addCause(exception, cause);
-                end
-
-                throw(exception);
-            end
-            % Remove the library extension
-            hid.slib = 'hidapiusb';
-
-            if hid.debug > 0
-                libfunctionsview('hidapiusb');
-            end
-        end
-        
-        function delete(hid)
-            %hidapi.delete Delete hid object
-            %
-            % delete(hid) closes an open hid device connection. This function is called 
-            % automatically when deleting.
-            %
-            % Notes::
-            % - You cannot unloadlibrary in this function as the object is
-            % still present in the MATLAB work space.
-            
-            if hid.debug > 0
-                fprintf('hidapi delete\n');
-            end
-        end
-        
-        %% Wrapper 
-        
-        function str = getManufacturersString(hid)
-            %hidapi.getManufacturersString get manufacturers string from hid object
-            %
-            % hid.getManufacturersString() returns the manufacturers string
-            % from the hid device using getHIDInfoString.
-            
-            str = getHIDInfoString(hid,'hid_get_manufacturer_string');
-        end
-        
-        function str = getProductString(hid)
-            %hidapi.getProductString get product string from hid object
-            %
-            % hid.getProductString() returns the product string from the
-            % hid device using getProductString.
-            
-            str = getHIDInfoString(hid,'hid_get_product_string');
-        end
-        
-        function str = getSerialNumberString(hid)
-            %hidapi.getSerialNumberString get product string from hid object
-            %
-            % hid.getSerialNumberString() returns the serial number string
-            % from the hid device using getSerialNumberString.
-            
-            str = getHIDInfoString(hid,'hid_get_serial_number_string');
-        end
-        
-        %% Wrapped HIDAPI-Functions
-        
-        function open(hid)
-            %hidapi.open Open a hid object
-            %
-            % hid.open() opens a connection with a hid device with the
-            % initialised values of vendorID and productID from the hidapi
-            % constructor.
-            %
-            % Throws::
-            %  CommError	Error during communication with device
-            %
-            % Notes::
-            % - The pointer return value from this library call is always
-            % null so it is not possible to know if the open was
-            % successful.
-            % - The final parameter to the open hidapi library call has
-            % different types depending on OS. In windows it is uint16 but
-            % linux/mac it is int32.
-            
-            if hid.debug > 0
-                fprintf('hidapi open\n');
-            end
-            
-            % Create a null pointer for the hid_open function (depends on OS)
-            if (ispc == 1)
-                pNull = libpointer('uint16Ptr');
-            elseif ((ismac == 1) || (isunix == 1))
-                pNull = libpointer('int32Ptr');
-            end
-            
-            % Open the hid interface
-            [newHandle,value] = calllib(hid.slib,'hid_open',uint16(hid.vendorID), ...
-                uint16(hid.productID),pNull);
-            
-            % (MMI) Assert error case (hid_open returns null-pointer in error case)
-            assert(isLibPointerValid(newHandle)==1, ...
-                [ID(), ':', 'CommError'], ...
-                'Failed to connect to USB device.');
-            
-            hid.handle = newHandle;
-        end
-        
-        function close(hid)
-            %hidapi.close Close hid object
-            %
-            % hid.close() closes the connection to a hid device. Gets called automatically
-            % when deleting the hid instance.
-            %
-            % Throws::
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi close\n');
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [ID(), ':', 'InvalidHandle'], ...
-                'Failed to close USB-connection because pointer to USB-device is already invalidated.');
-            
-            % Close the connection
-            calllib(hid.slib,'hid_close',hid.handle);
-            
-            % Invalidate the pointer
-            hid.handle = [];
-        end
-        
-        function rmsg = read(hid)
-            %hidapi.rmsg Read from hid object
-            %
-            % rmsg = hid.read() reads from a hid device and returns the
-            % read bytes. Will print an error if no data was read.
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle    Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi read\n');
-            end
-            
-            % Read buffer of nReadBuffer length
-            buffer = zeros(1,hid.nReadBuffer);
-            % Create a uint8 pointer
-            pbuffer = libpointer('uint8Ptr', uint8(buffer));
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [ID(), ':', 'InvalidHandle'], ...
-                'Failed to read USB-data because pointer to USB-device is invalidated.');
-            
-            % Read data from HID device
-            [res,h] = calllib(hid.slib,'hid_read',hid.handle,pbuffer,uint64(length(buffer)));
-            
-            % (MMI) Check the response (No assert as there are multiple cases)
-            if res < 1
-                % Error occurred
-                id = [ID(), ':', 'CommError'];
-                % Narrow error down
-                if res == -1
-                    msg = 'Connection error (probably lost connection to device)';
-                elseif res == 0
-                    msg = ['Could not read data from device (device is still connected, ',...
-                           'but does not react)'];
-                else
-                    msg = 'Unexpected connection error';
-                end
-                causeException = MException(id, msg);
-                ME = MException(id, 'Failed to read data via USB.');
-                addCause(ME, causeException);
-                throw(ME);
-            end
-            
-            % Return the string value
-            rmsg = pbuffer.Value;
-        end
-        
-        function write(hid,wmsg,reportID)
-            %hidapi.write Write to hid object
-            %
-            % hid.write() writes to a hid device. Will print an error if
-            % there is a mismatch between the buffer size and the reported
-            % number of bytes written.
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi write\n');
-            end
-            
-            % Append a 0 at the front for HID report ID
-            wmsg = [reportID wmsg];
-            
-            % Pad with zeros for nWriteBuffer length
-            % (MMI) Note:: The following line does not seem to be necessary;
-            % wmsg does not need to be the max packet size. Uncommenting this doesn't affect
-            % anything, and I would prefer sending short messages over long ones.
-            % Further testing may be required, so for now I don't change a thing.
-            wmsg(end+(hid.nWriteBuffer-length(wmsg))) = 0;
-            
-            % Create a uint8 pointer
-            pbuffer = libpointer('uint8Ptr', uint8(wmsg));
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [ID(), ':', 'InvalidHandle'], ...
-                'Failed to write to USB because pointer to USB-device is invalidated.');
-            
-            % Write the message
-            [res,h] = calllib(hid.slib,'hid_write',hid.handle,pbuffer,uint64(length(wmsg)));
-            
-            % (MMI) Check the response
-            assert(res == length(wmsg), ...
-                [ID(), ':', 'CommError'], ...
-                'Failed to write data via USB.');
-        end
-        
-        function str = getHIDInfoString(hid,info)
-            %hidapi.getHIDInfoString get hid information from object
-            %
-            % hid.getHIDInfoString(info) gets the corresponding hid info
-            % from the hid device
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            % Notes::
-            % - info is the hid information string.
-            
-            if hid.debug > 0
-                fprintf(['hidapi ' info '\n']);
-            end
-            % Read buffer nReadBuffer length
-            buffer = zeros(1,hid.nReadBuffer);
-            % Create a libpointer (depends on OS)
-            if (ispc == 1)
-                pbuffer = libpointer('uint16Ptr', uint16(buffer));
-            elseif ((ismac == 1) || (isunix == 1))
-                pbuffer = libpointer('int32Ptr', uint32(buffer));
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [ID(), ':', 'InvalidHandle'], ...
-                'Failed to read USB-data because pointer to USB-device is invalidated.');
-            
-            % Get the HID info string
-            [res,h] = calllib(hid.slib,info,hid.handle,pbuffer,uint32(length(buffer)));
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [ID(), ':', 'CommError'], ...
-                'Failed to read HID info string.');
-            
-            % Return the string value
-            str = sprintf('%s',char(pbuffer.Value));
-        end
-        
-        function setNonBlocking(hid,nonblock)
-            %hidapi.setNonBlocking sets non blocking on the hid object
-            %
-            % hid.setNonBlocking(nonblock) sets the non blocking flag on
-            % the hid device connection.
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            % Notes::
-            % nonblock - 0 disables nonblocking, 1 enables nonblocking
-            
-            if hid.debug > 0
-                fprintf('hidapi setNonBlocking\n');
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [ID(), ':', 'InvalidHandle'], ...
-                'Failed to set USB-read-mode to non-blocking because pointer to USB-device is invalidated.');
-            
-            % Set non blocking
-            [res,h] = calllib(hid.slib,'hid_set_nonblocking',hid.handle,uint32(nonblock));
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [ID(), ':', 'CommError'], ...
-                'Failed to set USB-read-mode to non-blocking.');
-        end
-        
-        function init(hid)
-            %hidapi.init Init hidapi
-            %
-            % hid.init() inits the hidapi library. This is called
-            % automatically in the library itself with the open function.
-            %
-            % Throws::
-            %  CommError	Error during communication with device
-            %
-            % Notes::
-            % - You should not have to call this function directly.
-            
-            if hid.debug > 0
-                fprintf('hidapi init\n');
-            end
-            
-            warning([ID(), ':', 'RedundantCall'], ...
-                'The init-function gets called automatically when connecting!');
-            
-            % Init device
-            res = calllib(hid.slib,'hid_init');
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [ID(), ':', 'CommError'], ...
-                'Failed to init USB-device.');
-        end
-        
-        function exit(hid)
-            %hidapi.exit Exit hidapi
-            %
-            % hid.exit() exits the hidapi library.
-            %
-            % Throws::
-            %  CommError	Error during communication with device
-            %
-            % Notes::
-            % - You should not have to call this function directly.
-            
-            if hid.debug > 0
-                fprintf('hidapi exit\n');
-            end
-            
-            warning([ID(), ':', 'RedundantCall'], ...
-                'The exit-function gets called automatically when disconnecting!');
-            
-            % Exit device
-            res = calllib(hid.slib,'hid_exit');
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [ID(), ':', 'CommError'], ...
-                'Failed to exit USB-device.');
-        end
-        
-        function str = error(hid)
-            %hidapi.error Output the hid object error string
-            %
-            % hid.error() returns the hid device error string if a function
-            % produced an error.
-            %
-            % Throws::
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            % Notes::
-            % - This function must be called explicitly if you think an
-            % error was generated from the hid device.
-            
-            if hid.debug > 0
-                fprintf('hidapi error\n');
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [ID(), ':', 'InvalidHandle'], ...
-                'Failed to read USB-error-data because pointer to USB-device is invalidated.');
-            
-            [~,str] = calllib(hid.slib,'hid_error',hid.handle);
-        end
-        
-        function str = enumerate(hid,vendorID,productID)
-            %hidapi.enumerate Enumerates the hid object
-            %
-            % str = hid.enumerate(vendorID,productID) enumerates the hid
-            % device with the given vendorID and productID and returns a
-            % string with the returned hid information.
-            %
-            % Notes::
-            % - vendorID is the vendor ID (in decimal not hex).
-            % - productID is the vendor ID (in decimal not hex).
-            % - Using a vendorID and productID of (0,0) will enumerate all
-            % connected hid devices.
-            % - MATLAB does not have the hid_device_infoPtr struct so some
-            % of the returned information will need to be resized and cast
-            % into uint8 or chars.
-            
-            if hid.debug > 0
-                fprintf('hidapi enumerate\n');
-            end
-            
-            % Enumerate the hid devices
-            str = calllib(u.slib,'hid_enumerate',uint16(vendorID),uint16(productID));
-        end
-    end
-end
-
-
-function valid = isLibPointerValid(handle)
-    %isHandleValid Check whether hid.handle is valid libpointer
-
-    valid = 0;
-    if ~isempty(handle)
-        if isa(handle, 'handle') && ~isNull(handle)
-            valid = 1;
-        end
-    end
-end
+classdef hidapi < handle      
+    % Interface to the hidapi library
+    % 
+    % Notes:
+    %     * Developed from the hidapi available at http://www.signal11.us/oss/hidapi/.
+    %     * Windows: hidapi.dll needed.
+    %     * Mac: hidapi.dylib needed. In addition, Xcode has to be installed.
+    %     * Linux: hidapi has to be compiled on host-system. 
+    % 
+    % Attributes:
+    %     handle ():
+    %     vendorID (numeric): Vendor-ID of the USB device.
+    %     productID (numeric): Product-ID of the USB device. 
+    %     nReadBuffer (numeric): Read-buffer size in bytes.
+    %     nWriteBuffer (numeric): Write-buffer size in bytes. Needs to be 1 Byte bigger than
+    %        actual packet.
+    %     slib (string): Name of shared library file (without file extension). Defaults to
+    %        'hidapi'.
+    %     sheader (string): Name of shared library header. Defaults to 'hidapi.h'.
+    %
+    % Example:
+    %     hidHandle = hidapi(1684,0005,1024,1025); %|br|
+    %
+    
+    properties
+        % handle: Connection handle to the device.
+        handle
+        % vendorID (numeric): Vendor-ID of the USB device.
+        vendorID;
+        % productID (numeric): Product-ID of the USB device.
+        productID;
+        % nReadBuffer (numeric): Read-buffer size in bytes. 
+        nReadBuffer;
+        % nWriteBuffer (numeric): Write-buffer size in bytes.
+        %    Needs to be 1 Byte bigger than actual packet.
+        nWriteBuffer;
+        % slib (string): Name of shared library file (without file extension). Defaults to 'hidapi'.
+        slib = 'hidapi';
+        % sheader (string): Name of shared library header. Defaults to 'hidapi.h'.
+        sheader = 'hidapi.h';
+    end
+    
+    methods
+        %% Constructor
+        
+        function hid = hidapi(vendorID,productID,nReadBuffer,nWriteBuffer)
+            % Create a hidapi library interface object from the corresponding library 
+            %
+            % Arguments:
+            %     vendorID (numeric): Vendor-ID of the USB device in decimal.
+            %     productID (numeric): Product-ID of the USB device in decimal. 
+            %     nReadBuffer (numeric): Read-buffer size in bytes.
+            %     nWriteBuffer (numeric): Write-buffer size in bytes. Needs to be 1 Byte bigger than
+            %        actual packet.
+            %
+            % Raises:
+            %     LoadingLibraryError: Could not load .dll/.dylib/.so-file of hidapi.
+            %     InvalidFileNameOrFileMissing: Either file names given were wrong or the files 
+            %        are missing (thunk files, proto files, ...).
+            %
+            
+            hid.vendorID = vendorID;
+            hid.productID = productID;
+            hid.nReadBuffer = nReadBuffer;
+            hid.nWriteBuffer = nWriteBuffer;
+            
+            % Disable warnings
+            warning('off','MATLAB:loadlibrary:TypeNotFoundForStructure');
+            warning('off', 'MATLAB:loadlibrary:ClassIsLoaded');
+            
+            try
+                % Check the operating system type and load slib
+                if (ispc == 1)
+                    % Check the bit version
+                    if (strcmp(mexext,'mexw32'))
+                        hid.slib = 'hidapi32';
+                        % Load the library via the proto file
+                        loadlibrary(hid.slib,@hidapi32_proto,'alias','hidapiusb')
+                    elseif (strcmp(mexext,'mexw64'))
+                        hid.slib = 'hidapi64';
+                        % Load the library via the proto file
+                        loadlibrary(hid.slib,@hidapi64_proto,'alias','hidapiusb')
+                    end
+                elseif (ismac == 1)
+                    hid.slib = 'hidapi64';
+                    % Load the library via the proto file
+                    loadlibrary(hid.slib,@hidapi64mac_proto,'alias','hidapiusb');
+                elseif (isunix == 1)
+                    hid.slib = 'libhidapi-libusb';
+                    % Load the shared library
+                    loadlibrary(hid.slib,@hidapi_libusb_proto,'alias','hidapiusb');
+                end
+            catch ME
+                % Create own exception for clarification
+                id = [hid.slib, ':', 'LoadingLibraryError'];
+                msg = strcat({'Could not load library '}, {hid.slib}, {'.'});
+                exception = MException(id, msg);
+
+                % Try to narrow down loading failure
+                if isempty(findstr(ME.identifier, 'LoadFailed')) ...
+                        && isempty(findstr(ME.identifier, 'ErrorLoadingLibrary')) ...
+                        && isempty(findstr(ME.identifier, 'ErrorInHeader'))
+                    id = [hid.slib, ':', 'InvalidFileNameOrFileMissing'];
+                    msg = 'Invalid file names were given or files are not available.';
+                    cause = MException(id, msg);
+                    exception = addCause(exception, cause);
+                end
+
+                throw(exception);
+            end
+            
+            % Remove the library extension
+            hid.slib = 'hidapiusb';
+
+%             if hid.debug > 0
+%                 libfunctionsview('hidapiusb');
+%             end
+        end
+        
+        function delete(hid)
+            % Close an open hid device connection and delete the object. 
+            %
+            % Notes:
+            %     * You cannot unloadlibrary in this function as the object is still present 
+            %       in the MATLAB work space. Todo: Any alternative?
+        end
+        
+        %% HIDAPI-Functions
+        
+        function open(hid)
+            % Open a connection with a hid device
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %
+            % Notes: 
+            %     * Gets called automatically when creating an hidapi-object.
+            %     * The pointer return value from this library call is always null so it is not 
+            %       possible to know if the open was successful.
+            %     * The final parameter to the open hidapi library call has different types 
+            %       depending on OS. On windows it is uint16, on linux/mac int32.
+            
+            % Create a null pointer for the hid_open function (depends on OS)
+            if (ispc == 1)
+                pNull = libpointer('uint16Ptr');
+            elseif ((ismac == 1) || (isunix == 1))
+                pNull = libpointer('int32Ptr');
+            end
+            
+            % Open the hid interface
+            [newHandle,value] = calllib(hid.slib,'hid_open',uint16(hid.vendorID), ...
+                uint16(hid.productID),pNull);
+            
+            % (MMI) Assert error case (hid_open returns null-pointer in error case)
+            assert(isLibPointerValid(newHandle)==1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to connect to USB device.');
+            
+            hid.handle = newHandle;
+        end
+        
+        function close(hid)
+            % Close the connection to a hid device. 
+            %
+            % Throws:
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes:
+            %     * Gets called automatically when deleting the hidapi instance.
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to close USB-connection because pointer to USB-device is already invalidated.');
+            
+            % Close the connection
+            calllib(hid.slib,'hid_close',hid.handle);
+            
+            % Invalidate the pointer
+            hid.handle = [];
+        end
+        
+        % Implemented @ MMI
+        function rmsg = read_timeout(hid, timeOut)
+            % Read from a hid device with a timeout and return the read bytes. 
+            %
+            % Arguments:
+            %     timeOut (numeric >= 0): Milliseconds after which a timeout-error occurs if no 
+            %         packet could be read.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            
+            % Read buffer of nReadBuffer length
+            buffer = zeros(1,hid.nReadBuffer);
+            % Create a uint8 pointer
+            pbuffer = libpointer('uint8Ptr', uint8(buffer));
+            
+            % Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-data because pointer to USB-device is invalidated.');
+            
+            % Read data from HID device
+            [res,h] = calllib(hid.slib,'hid_read_timeout',hid.handle,pbuffer,uint64(length(buffer)),timeOut);
+            
+            % Check the response (No assert as there are multiple cases)
+            if res < 1
+                % Error occurred
+                id = [hid.slib, ':', 'CommError'];
+                % Narrow error down
+                if res == -1
+                    msg = 'Connection error (probably lost connection to device)';
+                elseif res == 0
+                    msg = ['Could not read data from device (device is still connected, ',...
+                           'but does not react)'];
+                else
+                    msg = 'Unexpected connection error';
+                end
+                causeException = MException(id, msg);
+                ME = MException(id, 'Failed to read data via USB.');
+                addCause(ME, causeException);
+                throw(ME);
+            end
+            
+            % Return the string value
+            rmsg = pbuffer.Value;
+        end
+        
+        function rmsg = read(hid)
+            % Read from a hid device and returns the read bytes.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            % 
+            % Notes: 
+            %     * Will print an error if no data was read.
+            %
+            
+            % Read buffer of nReadBuffer length
+            buffer = zeros(1,hid.nReadBuffer);
+            % Create a uint8 pointer
+            pbuffer = libpointer('uint8Ptr', uint8(buffer));
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-data because pointer to USB-device is invalidated.');
+            
+            % Read data from HID device
+            [res,h] = calllib(hid.slib,'hid_read',hid.handle,pbuffer,uint64(length(buffer)));
+            
+            % (MMI) Check the response (No assert as there are multiple cases)
+            if res < 1
+                % Error occurred
+                id = [hid.slib, ':', 'CommError'];
+                % Narrow error down
+                if res == -1
+                    msg = 'Connection error (probably lost connection to device)';
+                elseif res == 0
+                    msg = ['Could not read data from device (device is still connected, ',...
+                           'but does not react)'];
+                else
+                    msg = 'Unexpected connection error';
+                end
+                causeException = MException(id, msg);
+                ME = MException(id, 'Failed to read data via USB.');
+                addCause(ME, causeException);
+                throw(ME);
+            end
+            
+            % Return the string value
+            rmsg = pbuffer.Value;
+        end
+        
+        function write(hid,wmsg,reportID)
+            % Write to a hid device.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes: 
+            %     * Will print an error if there is a mismatch between the buffer size and the 
+            %       reported number of bytes written.
+            %
+            
+            % Append a 0 at the front for HID report ID
+            wmsg = [reportID wmsg];
+            
+            % Pad with zeros for nWriteBuffer length
+            % (MMI) Note:: The following line does not seem to be necessary;
+            % wmsg does not need to be the max packet size. Uncommenting this doesn't affect
+            % anything, and I would prefer sending short messages over long ones.
+            % Further testing may be required, so for now I don't change a thing.
+            % (MMI) Update:: Okay, so under Windows, this line IS necessary, as well as the
+            % fixed write-buffer size of 1025 bytes for EV3 (== wMaxPacketSize+1; smaller packets fail; 
+            % bigger packets do get handled by the brick, but the second assertion below will fail).
+            wmsg(end+(hid.nWriteBuffer-length(wmsg))) = 0;
+            
+            % Create a uint8 pointer
+            pbuffer = libpointer('uint8Ptr', uint8(wmsg));
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to write to USB because pointer to USB-device is invalidated.');
+            
+            % Write the message
+            [res,h] = calllib(hid.slib,'hid_write',hid.handle,pbuffer,uint64(length(wmsg)));
+            
+            % (MMI) Check the response
+            assert(res == length(wmsg), ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to write data via USB.');
+        end
+        
+        function str = getHIDInfoString(hid,info)
+            % Get the corresponding hid info from the hid device.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes:
+            %     * Info is the hid information string. 
+            %
+            % See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+            % HIDAPI.GETSERIALNUMBERSTRING.
+            %
+            
+            % Read buffer nReadBuffer length
+            buffer = zeros(1,hid.nReadBuffer);
+            % Create a libpointer (depends on OS)
+            if (ispc == 1)
+                pbuffer = libpointer('uint16Ptr', uint16(buffer));
+            elseif ((ismac == 1) || (isunix == 1))
+                pbuffer = libpointer('int32Ptr', uint32(buffer));
+            end
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-data because pointer to USB-device is invalidated.');
+            
+            % Get the HID info string
+            [res,h] = calllib(hid.slib,info,hid.handle,pbuffer,uint32(length(buffer)));
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to read HID info string.');
+            
+            % Return the string value
+            str = sprintf('%s',char(pbuffer.Value));
+        end
+        
+        function setNonBlocking(hid,nonblock)
+            % Set the non blocking flag on the hid device connection.
+            %
+            % Arguments:
+            %     nonblock (numeric in {0,1}): 0 disables nonblocking, 1 enables nonblocking
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to set USB-read-mode to non-blocking because pointer to USB-device is invalidated.');
+            
+            % Set non blocking
+            [res,h] = calllib(hid.slib,'hid_set_nonblocking',hid.handle,uint32(nonblock));
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to set USB-read-mode to non-blocking.');
+        end
+        
+        function init(hid)
+            % Inits the hidapi library. 
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %
+            % Notes:
+            %     * This is called automatically in the library itself with the open function. You 
+            %       should not have to call this function directly.
+            %
+            
+            warning([hid.slib, ':', 'RedundantCall'], ...
+                'The init-function gets called automatically when connecting!');
+            
+            % Init device
+            res = calllib(hid.slib,'hid_init');
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to init USB-device.');
+        end
+        
+        function exit(hid)
+            %hidapi.exit Exit hidapi
+            %
+            % hid.exit() exits the hidapi library.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %
+            % Notes::
+            % - You should not have to call this function directly.
+            
+            warning([hid.slib, ':', 'RedundantCall'], ...
+                'The exit-function gets called automatically when disconnecting!');
+            
+            % Exit device
+            res = calllib(hid.slib,'hid_exit');
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to exit USB-device.');
+        end
+        
+        function str = error(hid)
+            % Return the hid device error string if a function produced an error.
+            %
+            % Throws:
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes:
+            %     * This function must be called explicitly if you think an error was generated 
+            %       from the hid device.
+            % 
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-error-data because pointer to USB-device is invalidated.');
+            
+            [~,str] = calllib(hid.slib,'hid_error',hid.handle);
+        end
+        
+        function str = enumerate(hid,vendorID,productID)
+            % Enumerates the info about the hid device with the given vendorID and productID 
+            % and returns a string with the returned hid information.
+            %
+            % Arguments:
+            %     vendorID (numeric): Vendor-ID of the USB device in decimal.
+            %     productID (numeric): Product-ID of the USB device in decimal. 
+            %
+            % Notes:
+            %     * Using a vendorID and productID of (0,0) will enumerate all connected hid 
+            %       devices.
+            %     * MATLAB does not have the hid_device_infoPtr struct so some of the returned 
+            %       information will need to be resized and cast into uint8 or chars.
+            %
+            
+            % Enumerate the hid devices
+            str = calllib(u.slib,'hid_enumerate',uint16(vendorID),uint16(productID));
+        end
+        
+        %% Wrapper 
+        
+        function str = getManufacturersString(hid)
+            % Get manufacturers string from hid object using getHIDInfoString.
+            str = getHIDInfoString(hid,'hid_get_manufacturer_string');
+        end
+        function str = getProductString(hid)
+            % Get product string from hid object using getProductString.
+            str = getHIDInfoString(hid,'hid_get_product_string');
+        end
+        function str = getSerialNumberString(hid)
+            % Get serial number from hid object using getSerialNumberString.
+            str = getHIDInfoString(hid,'hid_get_serial_number_string');
+        end
+    end
+end
+
+% Implemented @ MMI
+function valid = isLibPointerValid(handle)
+    % Check whether hid.handle is valid libpointer
+
+    valid = 0;
+    if ~isempty(handle)
+        if isa(handle, 'handle') && ~isNull(handle)
+            valid = 1;
+        end
+    end
+end
diff --git a/source/hidapi_old.h b/source/hidapi_old.h
deleted file mode 100755
index 6c8c48396496ac4083ec81739fe0245db4e53066..0000000000000000000000000000000000000000
--- a/source/hidapi_old.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/*******************************************************
- HIDAPI - Multi-Platform library for
- communication with HID devices.
-
- Alan Ott
- Signal 11 Software
-
- 8/22/2009
-
- Copyright 2009, All Rights Reserved.
-
- At the discretion of the user of this library,
- this software may be licensed under the terms of the
- GNU Public License v3, a BSD-Style license, or the
- original HIDAPI license as outlined in the LICENSE.txt,
- LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
- files located at the root of the source distribution.
- These files may also be found in the public source
- code repository located at:
-        http://github.com/signal11/hidapi .
-********************************************************/
-
-/** @file
- * @defgroup API hidapi API
- */
-
-#ifndef HIDAPI_H__
-#define HIDAPI_H__
-
-#include <wchar.h>
-
-#ifdef _WIN32
-      #define HID_API_EXPORT __declspec(dllexport)
-      #define HID_API_CALL
-#else
-      #define HID_API_EXPORT /**< API export macro */
-      #define HID_API_CALL /**< API call macro */
-#endif
-
-#define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-		struct hid_device_;
-		typedef struct hid_device_ hid_device; /**< opaque hidapi structure */
-
-		/** hidapi info structure */
-		struct hid_device_info {
-			/** Platform-specific device path */
-			char *path;
-			/** Device Vendor ID */
-			unsigned short vendor_id;
-			/** Device Product ID */
-			unsigned short product_id;
-			/** Serial Number */
-			wchar_t *serial_number;
-			/** Device Release Number in binary-coded decimal,
-			    also known as Device Version Number */
-			unsigned short release_number;
-			/** Manufacturer String */
-			wchar_t *manufacturer_string;
-			/** Product string */
-			wchar_t *product_string;
-			/** Usage Page for this Device/Interface
-			    (Windows/Mac only). */
-			unsigned short usage_page;
-			/** Usage for this Device/Interface
-			    (Windows/Mac only).*/
-			unsigned short usage;
-			/** The USB interface which this logical device
-			    represents. Valid on both Linux implementations
-			    in all cases, and valid on the Windows implementation
-			    only if the device contains more than one interface. */
-			int interface_number;
-
-			/** Pointer to the next device */
-			struct hid_device_info *next;
-		};
-
-
-		/** @brief Initialize the HIDAPI library.
-
-			This function initializes the HIDAPI library. Calling it is not
-			strictly necessary, as it will be called automatically by
-			hid_enumerate() and any of the hid_open_*() functions if it is
-			needed.  This function should be called at the beginning of
-			execution however, if there is a chance of HIDAPI handles
-			being opened by different threads simultaneously.
-			
-			@ingroup API
-
-			@returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int HID_API_EXPORT HID_API_CALL hid_init(void);
-
-		/** @brief Finalize the HIDAPI library.
-
-			This function frees all of the static data associated with
-			HIDAPI. It should be called at the end of execution to avoid
-			memory leaks.
-
-			@ingroup API
-
-		    @returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int HID_API_EXPORT HID_API_CALL hid_exit(void);
-
-		/** @brief Enumerate the HID Devices.
-
-			This function returns a linked list of all the HID devices
-			attached to the system which match vendor_id and product_id.
-			If @p vendor_id and @p product_id are both set to 0, then
-			all HID devices will be returned.
-
-			@ingroup API
-			@param vendor_id The Vendor ID (VID) of the types of device
-				to open.
-			@param product_id The Product ID (PID) of the types of
-				device to open.
-
-		    @returns
-		    	This function returns a pointer to a linked list of type
-		    	struct #hid_device, containing information about the HID devices
-		    	attached to the system, or NULL in the case of failure. Free
-		    	this linked list by calling hid_free_enumeration().
-		*/
-		struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id);
-
-		/** @brief Free an enumeration Linked List
-
-		    This function frees a linked list created by hid_enumerate().
-
-			@ingroup API
-		    @param devs Pointer to a list of struct_device returned from
-		    	      hid_enumerate().
-		*/
-		void  HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs);
-
-		/** @brief Open a HID device using a Vendor ID (VID), Product ID
-			(PID) and optionally a serial number.
-
-			If @p serial_number is NULL, the first device with the
-			specified VID and PID is opened.
-
-			@ingroup API
-			@param vendor_id The Vendor ID (VID) of the device to open.
-			@param product_id The Product ID (PID) of the device to open.
-			@param serial_number The Serial Number of the device to open
-				               (Optionally NULL).
-
-			@returns
-				This function returns a pointer to a #hid_device object on
-				success or NULL on failure.
-		*/
-		HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number);
-
-		/** @brief Open a HID device by its path name.
-
-			The path name be determined by calling hid_enumerate(), or a
-			platform-specific path name can be used (eg: /dev/hidraw0 on
-			Linux).
-
-			@ingroup API
-		    @param path The path name of the device to open
-
-			@returns
-				This function returns a pointer to a #hid_device object on
-				success or NULL on failure.
-		*/
-		HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path);
-
-		/** @brief Write an Output report to a HID device.
-
-			The first byte of @p data[] must contain the Report ID. For
-			devices which only support a single report, this must be set
-			to 0x0. The remaining bytes contain the report data. Since
-			the Report ID is mandatory, calls to hid_write() will always
-			contain one more byte than the report contains. For example,
-			if a hid report is 16 bytes long, 17 bytes must be passed to
-			hid_write(), the Report ID (or 0x0, for devices with a
-			single report), followed by the report data (16 bytes). In
-			this example, the length passed in would be 17.
-
-			hid_write() will send the data on the first OUT endpoint, if
-			one exists. If it does not, it will send the data through
-			the Control Endpoint (Endpoint 0).
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param data The data to send, including the report number as
-				the first byte.
-			@param length The length in bytes of the data to send.
-
-			@returns
-				This function returns the actual number of bytes written and
-				-1 on error.
-		*/
-		int  HID_API_EXPORT HID_API_CALL hid_write(hid_device *device, const unsigned char *data, size_t length);
-
-		/** @brief Read an Input report from a HID device with timeout.
-
-			Input reports are returned
-			to the host through the INTERRUPT IN endpoint. The first byte will
-			contain the Report number if the device uses numbered reports.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param data A buffer to put the read data into.
-			@param length The number of bytes to read. For devices with
-				multiple reports, make sure to read an extra byte for
-				the report number.
-			@param milliseconds timeout in milliseconds or -1 for blocking wait.
-
-			@returns
-				This function returns the actual number of bytes read and
-				-1 on error.
-		*/
-		int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds);
-
-		/** @brief Read an Input report from a HID device.
-
-			Input reports are returned
-		    to the host through the INTERRUPT IN endpoint. The first byte will
-			contain the Report number if the device uses numbered reports.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param data A buffer to put the read data into.
-			@param length The number of bytes to read. For devices with
-				multiple reports, make sure to read an extra byte for
-				the report number.
-
-			@returns
-				This function returns the actual number of bytes read and
-				-1 on error.
-		*/
-		int  HID_API_EXPORT HID_API_CALL hid_read(hid_device *device, unsigned char *data, size_t length);
-
-		/** @brief Set the device handle to be non-blocking.
-
-			In non-blocking mode calls to hid_read() will return
-			immediately with a value of 0 if there is no data to be
-			read. In blocking mode, hid_read() will wait (block) until
-			there is data to read before returning.
-
-			Nonblocking can be turned on and off at any time.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param nonblock enable or not the nonblocking reads
-			 - 1 to enable nonblocking
-			 - 0 to disable nonblocking.
-
-			@returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int  HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *device, int nonblock);
-
-		/** @brief Send a Feature report to the device.
-
-			Feature reports are sent over the Control endpoint as a
-			Set_Report transfer.  The first byte of @p data[] must
-			contain the Report ID. For devices which only support a
-			single report, this must be set to 0x0. The remaining bytes
-			contain the report data. Since the Report ID is mandatory,
-			calls to hid_send_feature_report() will always contain one
-			more byte than the report contains. For example, if a hid
-			report is 16 bytes long, 17 bytes must be passed to
-			hid_send_feature_report(): the Report ID (or 0x0, for
-			devices which do not use numbered reports), followed by the
-			report data (16 bytes). In this example, the length passed
-			in would be 17.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param data The data to send, including the report number as
-				the first byte.
-			@param length The length in bytes of the data to send, including
-				the report number.
-
-			@returns
-				This function returns the actual number of bytes written and
-				-1 on error.
-		*/
-		int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *device, const unsigned char *data, size_t length);
-
-		/** @brief Get a feature report from a HID device.
-
-			Make sure to set the first byte of @p data[] to the Report
-			ID of the report to be read.  Make sure to allow space for
-			this extra byte in @p data[].
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param data A buffer to put the read data into, including
-				the Report ID. Set the first byte of @p data[] to the
-				Report ID of the report to be read.
-			@param length The number of bytes to read, including an
-				extra byte for the report ID. The buffer can be longer
-				than the actual report.
-
-			@returns
-				This function returns the number of bytes read and
-				-1 on error.
-		*/
-		int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *device, unsigned char *data, size_t length);
-
-		/** @brief Close a HID device.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-		*/
-		void HID_API_EXPORT HID_API_CALL hid_close(hid_device *device);
-
-		/** @brief Get The Manufacturer String from a HID device.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param string A wide string buffer to put the data into.
-			@param maxlen The length of the buffer in multiples of wchar_t.
-
-			@returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *device, wchar_t *string, size_t maxlen);
-
-		/** @brief Get The Product String from a HID device.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param string A wide string buffer to put the data into.
-			@param maxlen The length of the buffer in multiples of wchar_t.
-
-			@returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int HID_API_EXPORT_CALL hid_get_product_string(hid_device *device, wchar_t *string, size_t maxlen);
-
-		/** @brief Get The Serial Number String from a HID device.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param string A wide string buffer to put the data into.
-			@param maxlen The length of the buffer in multiples of wchar_t.
-
-			@returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *device, wchar_t *string, size_t maxlen);
-
-		/** @brief Get a string from a HID device, based on its string index.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-			@param string_index The index of the string to get.
-			@param string A wide string buffer to put the data into.
-			@param maxlen The length of the buffer in multiples of wchar_t.
-
-			@returns
-				This function returns 0 on success and -1 on error.
-		*/
-		int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *device, int string_index, wchar_t *string, size_t maxlen);
-
-		/** @brief Get a string describing the last error which occurred.
-
-			@ingroup API
-			@param device A device handle returned from hid_open().
-
-			@returns
-				This function returns a string containing the last error
-				which occurred or NULL if none has occurred.
-		*/
-		HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *device);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/source/private/DeviceMode.m b/source/private/DeviceMode.m
index a66536f6af7a31a9bc94813cb63420cf4c898720..17ab32ce54059136984535f150b06d11705e542a 100755
--- a/source/private/DeviceMode.m
+++ b/source/private/DeviceMode.m
@@ -7,45 +7,16 @@ function mode = DeviceMode(type, modeNo)
     end
     
     try
-        switch type
-            case DeviceType.NXTTouch
-                mode = DeviceMode.NXTTouch(modeNo);
-            case DeviceType.NXTLight
-                mode = DeviceMode.NXTLight(modeNo);
-            case DeviceType.NXTSound
-                mode = DeviceMode.NXTSound(modeNo);
-            case DeviceType.NXTColor
-                mode = DeviceMode.NXTColor(modeNo);
-            case DeviceType.NXTUltraSonic
-                mode = DeviceMode.NXTUltraSonic(modeNo);
-            case DeviceType.NXTTemperature
-                mode = DeviceMode.NXTTemperature(modeNo);
-            case DeviceType.LargeMotor
-                mode = DeviceMode.Motor(modeNo);
-            case DeviceType.MediumMotor
-                mode = DeviceMode.Motor(modeNo);
-            case DeviceType.Touch
-                mode = DeviceMode.Touch(modeNo);
-            case DeviceType.Color
-                mode = DeviceMode.Color(modeNo);
-            case DeviceType.UltraSonic
-                mode = DeviceMode.UltraSonic(modeNo);
-            case DeviceType.Gyro
-                mode = DeviceMode.Gyro(modeNo);
-            case DeviceType.InfraRed
-                mode = DeviceMode.InfraRed(modeNo);
-            case DeviceType.HTColor
-                mode = DeviceMode.HTColor(modeNo);
-            case DeviceType.HTCompass
-                mode = DeviceMode.HTCompass(modeNo);
-            case DeviceType.HTAccelerometer
-                mode = DeviceMode.HTAccelerometer(modeNo);
-            otherwise
-                mode = DeviceMode.Default.Undefined; % Need to think about this...
+        % Motors are a special case where the mode name does not equal the type name
+        if type == DeviceType.LargeMotor || type == DeviceType.MediumMotor
+            mode = DeviceMode.Motor(modeNo);
+        elseif type == DeviceType.Unknown || type == DeviceType.None || type == DeviceType.Error
+            mode = DeviceMode.Default.Undefined;
+        else
+            mode = DeviceMode.(char(type))(modeNo);
         end
-    catch 
-        error('MATLAB:RWTHMindstormsEV3:noclass:DeviceMode:invalidInputValue',...
-              'ModeNo ''%d'' not valid for given type.', modeNo);
+    catch ME
+        error('ModeNo ''%d'' not valid for given type.', modeNo);
     end
 end
 
diff --git a/source/private/isModeValid.m b/source/private/isModeValid.m
index 1bec154a662a1d0acf7804b69014a689949fd97f..a5049f978e727186f74f09b1ab612addab88bfe8 100755
--- a/source/private/isModeValid.m
+++ b/source/private/isModeValid.m
@@ -1,78 +1,12 @@
 function isValid = isModeValid(mode, type)
 % Returns whether given mode is a valid mode in given type.
-    isValid = true;
-    
     if strcmp(class(mode), 'DeviceMode.Default')
+        isValid = true;
         return;
     end
-
-    switch type
-        case DeviceType.NXTTouch
-            if ~strcmp(class(mode), 'DeviceMode.NXTTouch')
-                isValid = false;
-            end
-        case DeviceType.NXTLight
-            if ~strcmp(class(mode), 'DeviceMode.NXTLight')
-                isValid = false;
-            end
-        case DeviceType.NXTSound
-            if ~strcmp(class(mode), 'DeviceMode.NXTSound')
-                isValid = false;
-            end
-        case DeviceType.NXTColor
-            if ~strcmp(class(mode), 'DeviceMode.NXTColor')
-                isValid = false;
-            end
-        case DeviceType.NXTUltraSonic
-            if ~strcmp(class(mode), 'DeviceMode.NXTUltraSonic')
-                isValid = false;
-            end
-        case DeviceType.NXTTemperature
-            if ~strcmp(class(mode), 'DeviceMode.NXTTemperature')
-                isValid = false;
-            end
-        case DeviceType.LargeMotor
-            if ~strcmp(class(mode), 'DeviceMode.Motor')
-                isValid = false;
-            end
-        case DeviceType.MediumMotor
-            if ~strcmp(class(mode), 'DeviceMode.Motor')
-                isValid = false;
-            end
-        case DeviceType.Touch
-            if ~strcmp(class(mode), 'DeviceMode.Touch')
-                isValid = false;
-            end
-        case DeviceType.Color
-            if ~strcmp(class(mode), 'DeviceMode.Color')
-                isValid = false;
-            end
-        case DeviceType.UltraSonic
-            if ~strcmp(class(mode), 'DeviceMode.UltraSonic')
-                isValid = false;
-            end
-        case DeviceType.Gyro
-            if ~strcmp(class(mode), 'DeviceMode.Gyro')
-                isValid = false;
-            end
-        case DeviceType.InfraRed
-            if ~strcmp(class(mode), 'DeviceMode.InfraRed')
-                isValid = false;
-            end
-        case DeviceType.HTColor
-            if ~strcmp(class(mode), 'DeviceMode.HTColor')
-                isValid = false;
-            end
-        case DeviceType.HTCompass
-            if ~strcmp(class(mode), 'DeviceMode.HTCompass')
-                isValid = false;
-            end
-        case DeviceType.HTAccelerometer
-            if ~strcmp(class(mode), 'DeviceMode.HTAccelerometer')
-                isValid = false;
-            end
-        otherwise
-            isValid = false;
-    end
-end
-
+    
+    % A mode is valid for a given type if the name of the type (e.g. Color)
+    % equals the name of the enumeration corresponding to the mode (e.g. Color in
+    % DeviceMode.Color.Ambient)
+    isValid = strcmp(char(type), strrep(class(mode), 'DeviceMode.', ''));
+end
\ No newline at end of file
diff --git a/source/tb_optparse.m b/source/tb_optparse.m
deleted file mode 100755
index 2fedb2b14a51fe749d72f97268a0de2b03513f02..0000000000000000000000000000000000000000
--- a/source/tb_optparse.m
+++ /dev/null
@@ -1,193 +0,0 @@
-%OPTPARSE Standard option parser for Toolbox functions
-%
-% [OPTOUT,ARGS] = TB_OPTPARSE(OPT, ARGLIST) is a generalized option parser for
-% Toolbox functions.  It supports options that have an assigned value, boolean 
-% or enumeration types (string or int).
-%
-% The software pattern is:
-%
-%       function(a, b, c, varargin)
-%       opt.foo = true;
-%       opt.bar = false;
-%       opt.blah = [];
-%       opt.choose = {'this', 'that', 'other'};
-%       opt.select = {'#no', '#yes'};
-%       opt = tb_optparse(opt, varargin);
-%
-% Optional arguments to the function behave as follows:
-%   'foo'           sets opt.foo <- true
-%   'nobar'         sets opt.foo <- false
-%   'blah', 3       sets opt.blah <- 3
-%   'blah', {x,y}   sets opt.blah <- {x,y}
-%   'that'          sets opt.choose <- 'that'
-%   'yes'           sets opt.select <- 2 (the second element)
-%
-% and can be given in any combination.
-%
-% If neither of 'this', 'that' or 'other' are specified then opt.choose <- 'this'.
-% If neither of 'no' or 'yes' are specified then opt.select <- 1.
-%
-% Note:
-% - that the enumerator names must be distinct from the field names.
-% - that only one value can be assigned to a field, if multiple values
-%    are required they must be converted to a cell array.
-%
-% The allowable options are specified by the names of the fields in the
-% structure opt.  By default if an option is given that is not a field of 
-% opt an error is declared.  
-%
-% Sometimes it is useful to collect the unassigned options and this can be 
-% achieved using a second output argument
-%           [opt,arglist] = tb_optparse(opt, varargin);
-% which is a cell array of all unassigned arguments in the order given in
-% varargin.
-%
-% The return structure is automatically populated with fields: verbose and
-% debug.  The following options are automatically parsed:
-%   'verbose'           sets opt.verbose <- true
-%   'verbose=2'         sets opt.verbose <- 2 (very verbose)
-%   'verbose=3'         sets opt.verbose <- 3 (extremeley verbose)
-%   'verbose=4'         sets opt.verbose <- 4 (ridiculously verbose)
-%   'debug', N          sets opt.debug <- N
-%   'setopt', S         sets opt <- S
-%   'showopt'           displays opt and arglist
-
-function [opt,others] = tb_optparse(in, argv)
-
-    arglist = {};
-
-    argc = 1;
-    opt = in;
-    try
-        opt.verbose = false;
-        opt.debug = 0;
-    end
-
-    showopt = false;
-
-    while argc <= length(argv)
-        option = argv{argc};
-        assigned = false;
-        
-        if isstr(option)
-
-            switch option
-            % look for hardwired options
-            case 'verbose'
-                opt.verbose = true;
-                assigned = true;
-            case 'verbose=2'
-                opt.verbose = 2;
-                assigned = true;
-            case 'verbose=3'
-                opt.verbose = 3;
-                assigned = true;
-            case 'verbose=4'
-                opt.verbose = 4;
-                assigned = true;
-            case 'debug'
-                opt.debug = argv{argc+1};
-                argc = argc+1;
-                assigned = true;
-            case 'setopt'
-                new = argv{argc+1};
-                argc = argc+1;
-                assigned = true;
-
-
-                % copy matching field names from new opt struct to current one
-                for f=fieldnames(new)'
-                    if isfield(opt, f{1})
-                        opt = setfield(opt, f{1}, getfield(new, f{1}));
-                    end
-                end
-            case 'showopt'
-                showopt = true;
-                assigned = true;
-
-            otherwise
-                % does the option match a field in the opt structure?
-                if isfield(opt, option)
-                    val = getfield(opt, option);
-                    if islogical(val)
-                        % a logical variable can only be set by an option
-                        opt = setfield(opt, option, true);
-                    else
-                        % otherwise grab its value from the next arg
-                        opt = setfield(opt, option, argv{argc+1});
-                        argc = argc+1;
-                    end
-                    assigned = true;
-                elseif length(option)>2 && strcmp(option(1:2), 'no') && isfield(opt, option(3:end))
-                    val = getfield(opt, option(3:end));
-                    if islogical(val)
-                        % a logical variable can only be set by an option
-                        opt = setfield(opt, option(3:end), false);
-                        assigned = true;
-                    end
-                else
-                    % the option doesnt match a field name
-                    for field=fieldnames(opt)'
-                        val = getfield(opt, field{1});
-                        if iscell(val)
-                            for i=1:length(val)
-                                if isempty(val{i})
-                                    continue;
-                                end
-                                if strcmp(option, val{i})
-                                    opt = setfield(opt, field{1}, option);
-                                    assigned = true;
-                                    break;
-                                elseif val{i}(1) == '#' && strcmp(option, val{i}(2:end))
-                                    opt = setfield(opt, field{1}, i);
-                                    assigned = true;
-                                    break;
-                                end
-                            end
-                            if assigned
-                                break;
-                            end
-                        end
-                    end
-
-
-                end
-            end % switch
-        end
-        if ~assigned
-            % non matching options are collected
-            if nargout == 2
-                arglist = [arglist argv(argc)];
-            else
-                if isstr(argv{argc})
-                    error(['unknown options: ' argv{argc}]);
-                end
-            end
-        end
-        
-        argc = argc + 1;
-    end % while
-
-    % if enumerator value not assigned, set the default value
-    for field=fieldnames(in)'
-        if iscell(getfield(in, field{1})) && iscell(getfield(opt, field{1}))
-            val = getfield(opt, field{1});
-            if isempty(val{1})
-                opt = setfield(opt, field{1}, val{1});
-            elseif val{1}(1) == '#'
-                opt = setfield(opt, field{1}, 1);
-            else
-                opt = setfield(opt, field{1}, val{1});
-            end
-        end
-    end
-                        
-    if showopt
-        fprintf('Options:\n');
-        opt
-        arglist
-    end
-
-    if nargout == 2
-        others = arglist;
-    end
diff --git a/source/usbBrickIO.m b/source/usbBrickIO.m
old mode 100755
new mode 100644
index 06fd285c036c5086feb854475603e1da532de990..c0bd3ccdaba821bcf75c20886477d1ad7c55a352
--- a/source/usbBrickIO.m
+++ b/source/usbBrickIO.m
@@ -1,245 +1,280 @@
-%usbBrickIO USB interface between MATLAB and the brick
-%
-% Methods::
-%
-%  usbBrickIO    Constructor, initialises and opens the usb connection
-%  delete       Destructor, closes the usb connection
-%
-%  open         Open a usb connection to the brick
-%  close        Close the usb connection to the brick
-%  read         Read data from the brick through usb
-%  write        Write data to the brick through usb
-%
-% Example::
-%           usbbrick = usbBrickIO()
-%
-% Notes::
-% - Uses the hid library implementation in hidapi.m
-
-classdef usbBrickIO < BrickIO
-    properties
-        % debug input
-        debug = 0;
-        % vendor ID (EV3 = 0x0694)
-        vendorID = 1684;
-        % product ID (EV3 = 0x0005)
-        productID = 5;
-        % read buffer size
-        nReadBuffer = 1024;
-        % write buffer size
-        nWriteBuffer = 1024;
-    end
-    
-    properties (Access = 'protected')
-        % connection handle
-        handle
-    end 
-    
-    methods
-        function brickIO = usbBrickIO(varargin)
-            %usbBrickIO.usbBrickIO Create a usbBrickIO object
-            %
-            % usbbrick = usbBrickIO(varargin) is an object which
-            % initialises a usb connection between MATLAB and the brick
-            % using hidapi.m.
-            % 
-            % Notes::
-            % - Can take one parameter debug which is a flag specifying
-            % output printing (0 or 1).
-            
-            if nargin == 0
-                brickIO.debug = 0;
-            else
-                brickIO.debug = varargin{1}; 
-            end
-            
-            if brickIO.debug > 0
-                fprintf('usbBrickIO init\n');
-            end
-            
-            % Create the usb handle
-            try
-                brickIO.handle = hidapi(0,brickIO.vendorID,brickIO.productID, ...
-                                        brickIO.nReadBuffer,brickIO.nWriteBuffer);
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'InvalidParameterOrFileMissing'))
-                    % Throw a clean InvalidParameterOrFileMissing to avoid confusion in upper layers
-                    msg = ['Couldn''t load hidapi-library for USB connection due to a ' ...
-                           'missing file. Make sure the correct hidapi-library and its ' ...
-                           'corresponding thunk- and proto-files are available.'];
-                    id = [ID(), ':', 'InvalidParameterOrFileMissing'];
-                    throw(MException(id, msg));
-                elseif ~isempty(strfind(ME.identifier, 'LoadingLibraryError'))
-                    % Throw a clean LoadingLibraryError to avoid confusion in upper layers
-                    msg = 'Failed to load hidapi-library for USB connection.';
-                    id = [ID(), ':', 'LoadingLibraryError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while trying to load the HIDAPI-lib for USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-                                
-            % Open the brick IO connection
-            brickIO.open;
-        end
-        
-        function delete(brickIO)
-            %usbBrickIO.delete Delete the usbBrickIO object
-            %
-            % delete(brickIO) closes the usb connection handle
-            
-            if brickIO.debug > 0
-                fprintf('usbBrickIO delete\n');
-            end
-            
-            % Disconnect
-            try
-                brickIO.close;
-            catch
-                % Connection already closed (probably due to an error) - do nothing
-            end
-        end
-        
-        function open(brickIO)
-            %usbBrickIO.open Open the usbBrickIO object
-            %
-            % usbBrickIO.open() opens the usb handle through the hidapi
-            % interface.
-            
-            if brickIO.debug > 0
-                fprintf('usbBrickIO open\n');
-            end
-            
-            % Open the usb handle (MMI: and handle possible errors)
-            try
-                brickIO.handle.open;
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'CommError'))
-                    % Throw a clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to open connection to Brick via USB.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while trying to connect to the Brick via USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-        
-        function close(brickIO)
-            %usbBrickIO.close Close the usbBrickIO object
-            %
-            % usbBrickIO.close() closes the usb handle through the hidapi
-            % interface.
-            if brickIO.debug > 0
-                fprintf('usbBrickIO close\n');
-            end 
-            
-            try
-                % Close the usb handle
-                brickIO.handle.close;
-            catch ME
-                % Throw combined error because error did not happen due to known reasons...
-                msg = 'Unknown error occurred while closing the USB connection.';
-                id = [ID(), ':', 'UnknownError'];
-                newException = MException(id, msg);
-                newException = addCause(newException, ME);
-                throw(newException);
-            end
-        end
-        
-        function rmsg = read(brickIO)
-            %usbBrickIO.read Read data from the usbBrickIO object
-            %
-            % rmsg = usbBrickIO.read() reads data from the brick through
-            % usb and returns the data in uint8 format.
-            %
-            % Notes::
-            % - This function is blocking with no time out in the current
-            % implementation.
-            
-            if brickIO.debug > 0
-                fprintf('usbBrickIO read\n');
-            end 
-            
-            % Read from the usb handle
-            try
-                rmsg = brickIO.handle.read;
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'CommError'))
-                    % Throw a clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to read data from the Brick via USB due to connection-error.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
-                    % Throw a clean InvalidHandle to avoid confusion in upper layers
-                    msg = 'Failed to read data from the Brick via USB due to invalid handle to USB-device.';
-                    id = [ID(), ':', 'InvalidHandle'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while reading data from the Brick via USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-            
-            % Get the number of read bytes
-            pLength = double(typecast(uint8(rmsg(1:2)),'uint16')) + 2;
-            
-            % Format the read message (2 byte length plus message)
-            if pLength < length(rmsg)
-                rmsg = rmsg(1:pLength);
-            end
-        end
-        
-        function write(brickIO,wmsg)
-            %usbBrickIO.write Write data to the usbBrickIO object
-            %
-            % usbBrickIO.write(wmsg) writes data to the brick through usb.
-            %
-            % Notes::
-            % - wmsg is the data to be written to the brick via usb in  
-            % uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('usbBrickIO write\n');
-            end 
-            
-            % Write to the usb handle using report ID 0
-            try
-                brickIO.handle.write(wmsg,0);
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'CommError'))
-                    % Throw a clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to send data to Brick via USB due to connection-error.';
-                    id = 'RWTHMindstormsEV3:usbBrickIO:write:CommError';
-                    throw(MException(id, msg));
-                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
-                    % Throw a clean InvalidHandle to avoid confusion in upper layers
-                    msg = 'Failed to send data to Brick via USB due to invalid handle to USB-device.';
-                    id = [ID(), ':', 'InvalidHandle'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while sending data to the Brick via USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-    end 
-end
+classdef usbBrickIO < BrickIO      
+    % USB interface between MATLAB and the brick
+    %
+    % Notes:
+    %     * Uses the hid library implementation in hidapi.m
+    %     * The default parameters should always work when you try to connect to an EV3 brick,
+    %       so in nearly all use-cases, the constructor does not need any parameters (besides
+    %       'debug' eventually).
+    %
+    % Attributes:
+    %     debug (bool): If true, each open/close/read/write-call will be noted in the console.
+    %        Defaults to false.
+    %     vendorID (numeric): Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).
+    %     productID (numeric): Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).
+    %     nReadBuffer (numeric): Read-buffer size in bytes. Defaults to 1024.
+    %     nWriteBuffer (numeric): Write-buffer size in bytes. Needs to be 1 Byte bigger than
+    %        actual packet. Defaults to 1025 (EV3 USB maximum packet size = 1024).
+    %     timeOut (numeric >= 0): Milliseconds after which a timeout-error occurs if no packet could be
+    %        read. Defaults to 10000.
+    %
+    % Examples:
+    %    % Connecting via USB |br|
+    %    commHandle = usbBrickIO(); % |br|
+    %    % Connecting via USB with enabled debug output |br|
+    %    commHandle = usbBrickIO('debug', true); % |br|
+    %
+    
+    properties
+        % debug (bool): If true, each open/close/read/write-call will be noted in the console.
+        %    Defaults to false.
+        debug;
+        % vendorID (numeric): Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).
+        vendorID;
+        % productID (numeric): Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).
+        productID;
+        % nReadBuffer (numeric): Read-buffer size in bytes. Defaults to 1024.
+        nReadBuffer;
+        % nWriteBuffer (numeric): Write-buffer size in bytes. Defaults to 1025 (EV3 USB maximum packet size = 1024).
+        %    Needs to be 1 Byte bigger than actual packet. 
+        nWriteBuffer;
+        % timeOut (numeric >= 0): Milliseconds after which a timeout-error occurs if no packet could be read. Defaults to 10000.
+        timeOut;
+    end
+    
+    properties (Access = protected)
+        % handle: Connection handle to the device
+        handle
+    end 
+    
+    methods
+        function brickIO = usbBrickIO(varargin)
+            % Create an usbBrickIO object 
+            %
+            % Arguments:
+            %     varargin: Any number of property names as strings, each followed by the
+            %         desired value. 
+            %
+            % Examples: 
+            %    % Connecting via USB 
+            %    commHandle = usbBrickIO();
+            %    % Connecting via USB with enabled debug output
+            %    commHandle = usbBrickIO('debug', true);
+            %
+            % See also USBBRICKIO.SETPROPERTIES
+            
+            brickIO.setProperties(varargin{:});
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (USB init)\n');
+            end
+            
+            % Set the connection handle
+            try
+                brickIO.handle = hidapi(brickIO.vendorID,brickIO.productID, ...
+                                        brickIO.nReadBuffer,brickIO.nWriteBuffer);
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'InvalidParameterOrFileMissing'))
+                    % Throw a clean InvalidParameterOrFileMissing to avoid confusion in upper layers
+                    msg = ['Couldn''t load hidapi-library for USB connection due to a ' ...
+                           'missing file. Make sure the correct hidapi-library and its ' ...
+                           'corresponding thunk- and proto-files are available.'];
+                    id = [ID(), ':', 'InvalidParameterOrFileMissing'];
+                    throw(MException(id, msg));
+                elseif ~isempty(strfind(ME.identifier, 'LoadingLibraryError'))
+                    % Throw a clean LoadingLibraryError to avoid confusion in upper layers
+                    msg = 'Failed to load hidapi-library for USB connection.';
+                    id = [ID(), ':', 'LoadingLibraryError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while trying to load the HIDAPI-lib for USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+                                
+            % Open the connection
+            brickIO.open;
+        end
+        
+        function delete(brickIO)
+            % Delete the usbBrickIO object and closes the connection
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (USB delete)\n');
+            end
+            
+            % Disconnect
+            try
+                brickIO.close;
+            catch
+                % Connection already closed (probably due to an error) - do nothing
+            end
+        end
+        
+        function open(brickIO)
+            % Opens the usb connection to the brick through the hidapi interface.
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (USB open)\n');
+            end
+            
+            % Open the usb handle 
+            try
+                brickIO.handle.open;
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    % Throw a clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to open connection to Brick via USB.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while trying to connect to the Brick via USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+        
+        function close(brickIO)
+            % Closes the usb connection the brick through the hidapi interface.
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (USB close) \n');
+            end 
+            
+            try
+                % Close the usb handle
+                brickIO.handle.close;
+            catch ME
+                % Throw combined error because error did not happen due to known reasons...
+                msg = 'Unknown error occurred while closing the USB connection.';
+                id = [ID(), ':', 'UnknownError'];
+                newException = MException(id, msg);
+                newException = addCause(newException, ME);
+                throw(newException);
+            end
+        end
+        
+        function rmsg = read(brickIO)
+            % Reads data from the brick through usb using the hidapi interface and returns the data in uint8 format.
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (USB read)   ');
+            end 
+            
+            % Read from the usb handle
+            try
+                if brickIO.timeOut ~= 0
+                    rmsg = brickIO.handle.read_timeout(brickIO.timeOut);
+                else
+                    rmsg = brickIO.handle.read();
+                end
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    % Throw a clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to read data from the Brick via USB due to connection-error.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
+                    % Throw a clean InvalidHandle to avoid confusion in upper layers
+                    msg = 'Failed to read data from the Brick via USB due to invalid handle to USB-device.';
+                    id = [ID(), ':', 'InvalidHandle'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while reading data from the Brick via USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+            
+            % Get the number of read bytes
+            pLength = double(typecast(uint8(rmsg(1:2)),'uint16')) + 2;
+            
+            % Format the read message (2 byte length plus message)
+            if pLength < length(rmsg)
+                rmsg = rmsg(1:pLength);
+            end
+        end
+        
+        function write(brickIO,wmsg)
+            % Writes data to the brick through usb using the hidapi interface.
+            %
+            % Arguments:
+            %     wmsg (uint8 array): Data to be written to the brick via usb
+            
+            if brickIO.debug > 0
+                fprintf('\t(DEBUG) (USB write)  ');
+            end 
+            
+            % Write to the usb handle using report ID 0
+            try
+                brickIO.handle.write(wmsg,0);
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    % Throw a clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to send data to Brick via USB due to connection-error.';
+                    id = 'RWTHMindstormsEV3:usbBrickIO:write:CommError';
+                    throw(MException(id, msg));
+                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
+                    % Throw a clean InvalidHandle to avoid confusion in upper layers
+                    msg = 'Failed to send data to Brick via USB due to invalid handle to USB-device.';
+                    id = [ID(), ':', 'InvalidHandle'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while sending data to the Brick via USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+        
+        function set.timeOut(brickIO, timeOut)
+            if ~isnumeric(timeOut) || timeOut < 0
+                error(ID(), 'timeOut-period of USB-handle can only be set to positive numerical values.'); 
+            end
+            
+            brickIO.timeOut = timeOut*1000;
+        end 
+        function setProperties(brickIO, varargin)
+            % Sets multiple usbBrickIO properties at once using MATLAB's inputParser.
+            %
+            % The syntax is as follows: commHandle.setProperties('propertyName1',
+            % propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+            % are: debug, vendorID, productID, nReadBuffer, nWriteBuffer, timeOut.
+            %
+            % See also USBBRICKIO.DEBUG, USBBRICKIO.VENDORID, USBBRICKIO.PRODUCTID,
+            % USBBRICKIO.NREADBUFFER, USBBRICKIO.NWRITEBUFFER, USBBRICKIO.TIMEOUT
+            
+            p = inputParser();
+            
+            p.addOptional('debug', false);
+            p.addOptional('vendorID', 1684);
+            p.addOptional('productID', 5);
+            p.addOptional('nReadBuffer', 1024);
+            p.addOptional('nWriteBuffer', 1025);
+            p.addOptional('timeOut', 10000);
+            
+            p.parse(varargin{:});
+            
+            brickIO.debug = p.Results.debug;
+            brickIO.vendorID = p.Results.vendorID;
+            brickIO.productID = p.Results.productID;
+            brickIO.nReadBuffer = p.Results.nReadBuffer;
+            brickIO.nWriteBuffer = p.Results.nWriteBuffer;
+            brickIO.timeOut = p.Results.timeOut;
+        end
+    end 
+end
diff --git a/source/wfBrickIO.m b/source/wfBrickIO.m
deleted file mode 100755
index b234c566e96d57a98539f5b2182997912d2f317d..0000000000000000000000000000000000000000
--- a/source/wfBrickIO.m
+++ /dev/null
@@ -1,189 +0,0 @@
-%wfBrickIO Wifi interface between MATLAB and the brick
-%
-% Methods::
-%
-%  wfBrickIO    Constructor, initialises and opens the wifi connection
-%  delete       Destructor, closes the wifi connection
-%
-%  open         Open a wifi connection to the brick
-%  close        Close the wifi connection to the brick
-%  read         Read data from the brick through wifi
-%  write        Write data to the brick through wifi
-%
-% Example::
-%           wfbrick = wfBrickIO(1,'192.168.1.104',5555,'0016533dbaf5')
-%
-% Notes::
-% - Java string casting is inconsistent in MATLAB across different
-% operating systems. The purpose of OutputStreamSend is to ensure that the
-% correct string sequence is sent to the brick, no matter what operating
-% system MATLAB is running under.
-% - The OutputStreamSend class file will need to be present in the java
-% path before a wfBrickIO object is made.
-% - This class works across all 3 operating systems.
-
-classdef wfBrickIO < BrickIO
-    properties
-        % debug input
-        debug = 0;
-        % socket input strem
-        inputStream
-        % socket output stream
-        outputStream
-        % brick IP address
-        addr = '192.168.1.104';
-        % brick tcp port (default is 5555)
-        port = 5555;
-        % brick serial number
-        serialNum = '0016533dbaf5';
-    end
-    
-    properties (Access = 'protected')
-        % connection handle
-        handle
-    end 
-    
-    methods
-        
-        function brickIO = wfBrickIO(debug,addr,port,serialNum)
-            %wfBrickIO.wfBrickIO Create a wfBrickIO object
-            %
-            % wfbrick = wfBrickIO(debug,addr,port,serialNum) is an object
-            % which initialises and opens a wifi connection between MATLAB
-            % and the brick using java functions. The following string is
-            % sent to the brick
-            % ['GET /target?sn=' brickIO.serialNum ' VMTP1.0' char(10) 'Protocol: EV3']
-            % which initialises the conncetion. The brick returns 
-            % ['Accept:EV340']
-            % 
-            % Notes::
-            % - debug is a flag specifying output printing (0 or 1).
-            % - addr is the IP address of the brick
-            % - port is the TCP port of the brick (default is 5555)
-            % - serialNum is the serial number of the brick. The serial
-            % number can be found in the menu on the EV3 brick or obtained
-            % through the emitted UDP packet on port 3015.
-            
-            if nargin > 0
-                brickIO.debug = debug;
-                brickIO.addr = addr;
-                brickIO.port = port;
-                brickIO.serialNum = serialNum;
-            end
-            if brickIO.debug > 0
-                fprintf('wfBrickIO init\n');
-            end
-            % import the required java libraries
-            import java.io.*;
-            import java.net.*;
-            % add the java path to the class path
-            javaaddpath .
-            % open the brick IO connection
-            brickIO.handle = Socket(brickIO.addr, brickIO.port);
-            % set the input stream
-            brickIO.inputStream = DataInputStream(brickIO.handle.getInputStream);
-            % set the output stream
-            brickIO.outputStream = OutputStreamSend();
-            % connection message to the brick
-            wmsg = ['GET /target?sn=' brickIO.serialNum ' VMTP1.0' char(10) 'Protocol: EV3'];
-            if brickIO.debug > 0
-                fprintf('Sent: [ %s ]\n',char(wmsg));
-            end
-            % send the connection message
-            brickIO.write(wmsg);
-            % receive the reply
-            rmsg = brickIO.read;
-            if brickIO.debug > 0
-                fprintf('Returned: [ %s ]\n',char(rmsg));
-            end
-        end
-        
-        function delete(brickIO)
-            %wfBrickIO.delete Delete the wfBrickIO object
-            %
-            % delete(brickIO) closes the wifi connection handle
-            
-            if brickIO.debug > 0
-                fprintf('wfBrickIO delete\n');
-            end
-            % delete the wf handle 
-            brickIO.close
-        end
-        
-        function handle = open(brickIO)
-            %wfBrickIO.open Open the wfBrickIO object
-            %
-            % handle = wfBrickIO.open() returns a handle to the wifi 
-            % socket connection using the initialised IP address and TCP 
-            % port values from the wfBrickIO constructor.
-            
-            if brickIO.debug > 0
-                fprintf('wfBrickIO open\n');
-            end
-            % open the socket handle
-            handle = Socket(brickIO.addr, brickIO.port);
-        end
-        
-        function close(brickIO)
-            %wfBrickIO.close Close the wfBrickIO object
-            %
-            % wfBrickIO.close() closes the wifi socket connection
-            
-            if brickIO.debug > 0
-                fprintf('wfBrickIO close\n');
-            end 
-            % close the close handle
-            brickIO.handle.close();
-        end
-        
-        function rmsg = read(brickIO)
-            %wfBrickIO.read Read data from the wfBrickIO object
-            %
-            % rmsg = wfBrickIO.read() reads data from the brick through wifi
-            % and returns the data in uint8 format.
-            %
-            % Notes::
-            % - This function is blocking with no time out in the current
-            % implementation.
-            
-            if brickIO.debug > 0
-                fprintf('wfBrickIO read\n');
-            end 
-            % block until bytes have been received
-            while (brickIO.inputStream.available == 0)
-                
-            end
-            % get the number of bytes to be read from the input stream
-            nLength = brickIO.inputStream.available;
-            % read the bytes from the input stream
-            rmsg = zeros(1,nLength);
-            for ii=1:nLength
-                rmsg(ii) =  brickIO.inputStream.readByte;
-            end
-            % convert from double to int8
-            rmsg = cast(rmsg,'int8');
-            % change from int8 to uint8 (cannot do this in one step)
-            rmsg = typecast(rmsg,'uint8');
-        end
-        
-        function write(brickIO,wmsg)
-            %wfBrickIO.write Write data to the wfBrickIO object
-            %
-            % wfBrickIO.write(wmsg) writes data to the brick through wifi.
-            %
-            % Notes::
-            % - wmsg is the data to be written to the brick via wifi in  
-            % uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('wfBrickIO write\n');
-            end 
-            % add the message to the output stream
-            brickIO.outputStream.addtoBufferN(char(wmsg),length(wmsg));
-            % send the output stream data
-            brickIO.outputStream.send(brickIO.handle.getOutputStream());
-            % clear the output stream
-            brickIO.outputStream.clear();
-        end
-    end 
-end
\ No newline at end of file
diff --git a/tests/IsRunningVsCurrentSpeed.m b/tests/IsRunningVsCurrentSpeed.m
new file mode 100644
index 0000000000000000000000000000000000000000..bc882474282244a7351018419beb0d143c9ef56d
--- /dev/null
+++ b/tests/IsRunningVsCurrentSpeed.m
@@ -0,0 +1,53 @@
+%Variablen bitte anpassen
+clear all;
+brick=EV3;
+brick.connect('bt');
+motorToTest = brick.motorC;
+N = 50;
+
+tic;
+time = [];
+plotIsRunning = [];
+plotCurrentSpeed = [];
+
+%plotPower = [];
+figure('NumberTitle', 'off', 'Name', 'IsRunning vs CurrentSpeed');
+
+%Schleifendurchlauf
+for j = 1 : N
+
+    [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams;
+    executeMotorCmd(limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode, brick, motorToTest);
+    motorToTest
+    disp(syncedMode)
+
+    while (motorToTest.isRunning())
+        
+        time(end+1) = toc;
+        
+        %IsRunning/CurrentSpeed
+        plotIsRunning(end+1) = motorToTest.isRunning()*25;
+        plotCurrentSpeed(end+1) = motorToTest.currentSpeed();
+        plot(time, plotIsRunning, time, plotCurrentSpeed);
+        legend('isRunning', 'currentSpeed');
+        drawnow;
+        
+    end%while
+   
+    xxx = toc;
+    delta = 0;
+    while (delta <= 3)
+        time(end+1) = toc;
+        plotIsRunning(end+1) = motorToTest.isRunning()*25;
+        plotCurrentSpeed(end+1) = motorToTest.currentSpeed();
+        plot(time, plotIsRunning, time, plotCurrentSpeed);
+        legend('isRunning', 'currentSpeed');
+        drawnow;
+        
+        delta = toc - xxx;
+    end%while
+    
+end%for
+
+brick.disconnect;
+clear all;
diff --git a/tests/LimitValueVsTachoCount.m b/tests/LimitValueVsTachoCount.m
new file mode 100644
index 0000000000000000000000000000000000000000..a08aabd7915375d4267d563cf3b23c2b56d28642
--- /dev/null
+++ b/tests/LimitValueVsTachoCount.m
@@ -0,0 +1,39 @@
+%Variablen bitte anpassen
+clear all;
+brick=EV3;
+brick.connect('bt', 'serPort', '/dev/rfcomm1');
+motorToTest = brick.motorC;
+N = 10;
+
+tic;
+time = [];
+vPower = [];
+vBrakeMode = [];
+vTachoCount = [];
+vLimitValue = [];
+
+%Schleifendurchlauf
+for j = 1 : N
+    
+    [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams;
+    executeMotorCmd(limitValue, 'Tacho', brakeMode, speedRegulation, abs(power), syncedMode, brick, motorToTest);
+    motorToTest
+    disp(syncedMode)
+
+    while(motorToTest.isRunning())
+    end%while
+    pause(3);
+    vPower(end+1) = motorToTest.power();
+    if (strcmp(motorToTest.brakeMode(), 'Brake'))
+        vBrakeMode(end+1) = 1;
+    else
+        vBrakeMode(end+1) = 0;
+    end%if
+    vTachoCount(end+1) = motorToTest.tachoCount();
+    vLimitValue(end+1) = motorToTest.limitValue();
+    motorToTest.resetTachoCount();
+end%for
+
+%fprint(vPower, vBrakeMode, vTachoCount, vLimitValue);
+brick.disconnect;
+clear all;
\ No newline at end of file
diff --git a/tests/MotorBraking.m b/tests/MotorBraking.m
new file mode 100644
index 0000000000000000000000000000000000000000..47b6f2cb1e999dcef377c0bda4fe43274007cd93
--- /dev/null
+++ b/tests/MotorBraking.m
@@ -0,0 +1,21 @@
+b = EV3('debug', 2);
+b.connect('bt', 'serPort', '/dev/rfcomm0');
+m = b.motorA;
+sl = b.motorB;
+
+m.tachoLimit = 1000;
+m.brakeMode = 'Coast';
+
+counts = [];
+power = [60, 65, 70, 75, 80, 85, 90, 95, 100];
+
+for i=1:length(power)
+    m.resetTachoCount;
+    m.reset;
+    m.power = power(i);
+    m.syncedStart(sl);
+    m.waitFor();
+    counts = [counts, m.tachoCount];
+    b.beep;
+    b.debug = false;
+end
\ No newline at end of file
diff --git a/tests/TachoCountVsLimitValue.m b/tests/TachoCountVsLimitValue.m
new file mode 100644
index 0000000000000000000000000000000000000000..e8072e30ac4d37f9a8812f485f8e81cdf1d9415f
--- /dev/null
+++ b/tests/TachoCountVsLimitValue.m
@@ -0,0 +1,53 @@
+%Variablen bitte anpassen
+clear all;
+brick=EV3;
+brick.connect('bt');
+motorToTest = brick.motorC;
+N = 50;
+
+tic;
+time = [];
+plotIsRunning = [];
+plotTachoCount = [];
+plotLimitValue = [];
+
+%plotPower = [];
+figure('NumberTitle', 'off', 'Name', 'TachoCount vs LimitValue'); 
+
+%Schleifendurchlauf
+for j = 1 : N
+    
+    [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams;
+    executeMotorCmd(limitValue, 'Tacho', brakeMode, speedRegulation, power, syncedMode, brick, motorToTest);
+    motorToTest
+    disp(syncedMode)
+
+    while (motorToTest.isRunning())
+        
+        time(end+1) = toc;
+
+        %LimitValue/TachoCount
+        plotTachoCount(end+1) = motorToTest.tachoCount();
+        plotLimitValue(end+1) = motorToTest.limitValue();
+        plot(time, plotTachoCount, time, plotLimitValue);
+        drawnow;
+
+    end%while
+   
+    xxx = toc;
+    delta = 0;
+    
+    while (delta <= 3)
+        time(end+1) = toc;
+        plotTachoCount(end+1) = 0;
+        plotLimitValue(end+1) = motorToTest.limitValue();
+        plot(time, plotTachoCount, time, plotLimitValue);
+        drawnow;
+        
+        delta = toc - xxx;
+    end%while
+    motorToTest.resetTachoCount();
+end%for
+
+brick.disconnect;
+clear all;
\ No newline at end of file
diff --git a/tests/TachoCountVsSpeedRegulation.m b/tests/TachoCountVsSpeedRegulation.m
new file mode 100644
index 0000000000000000000000000000000000000000..e311a6576ffa01b096132478591b1f460dedbe39
--- /dev/null
+++ b/tests/TachoCountVsSpeedRegulation.m
@@ -0,0 +1,53 @@
+%Variablen bitte anpassen
+clear all;
+brick=EV3;
+brick.connect('bt', 'serPort', '/dev/rfcomm1');
+motorToTest = brick.motorC;
+N = 50;
+
+tic;
+time = [];
+plotTachoCount = [];
+plotSpeedRegulation = [];
+
+figure('NumberTitle', 'off', 'Name', 'TachoCount vs SpeedRegulation');
+
+%Schleifendurchlauf
+for j = 1 : N
+    
+    [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams;
+    executeMotorCmd(limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode, brick, motorToTest);
+    motorToTest
+    disp(syncedMode)
+
+    while (motorToTest.isRunning())
+        
+        time(end+1) = toc;
+
+        %Power/TachoCount/SpeedReg
+        plotTachoCount(end+1) = motorToTest.tachoCount/10;
+        plotSpeedRegulation(end+1) = motorToTest.speedRegulation*30;
+        plot(time, plotTachoCount, time, plotSpeedRegulation);
+        legend('TachoCount', 'SpeedRegulation')
+        drawnow;
+
+    end%while
+   
+    xxx = toc;
+    delta = 0;
+    
+    while (delta <= 3)
+        time(end+1) = toc;
+        plotTachoCount(end+1) = motorToTest.tachoCount()/10;
+        plotSpeedRegulation(end+1) = motorToTest.speedRegulation()*30;
+        plot(time, plotTachoCount, time, plotSpeedRegulation);
+        legend('TachoCount','SpeedRegulation')
+        drawnow;
+        delta = toc - xxx;
+    end%while
+    motorToTest.resetTachoCount();
+    pause(1);
+end%for
+
+brick.disconnect;
+clear all;
\ No newline at end of file
diff --git a/tests/checkMatlabPauseCommand.m b/tests/checkMatlabPauseCommand.m
new file mode 100644
index 0000000000000000000000000000000000000000..89c59fd1f68e5d092538e29d36194508d7f9b6e5
--- /dev/null
+++ b/tests/checkMatlabPauseCommand.m
@@ -0,0 +1,23 @@
+close all
+clear all
+
+N = 5000;
+t = zeros(N, 1);
+tic 
+
+t = 0;
+j = 0;
+while(toc < 5)
+    j = j + 1;
+    t(j) = toc;
+    pause(0.010);
+end
+
+figure;
+plot(t, '.-')
+grid on
+hold all
+
+figure;
+hist(diff(t));
+    
\ No newline at end of file
diff --git a/tests/executeMotorCmd.m b/tests/executeMotorCmd.m
new file mode 100644
index 0000000000000000000000000000000000000000..d27fbc9ef0e6053961b6b1b1902b2f349bca11c6
--- /dev/null
+++ b/tests/executeMotorCmd.m
@@ -0,0 +1,31 @@
+function [] = executeMotorCmd(limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode, ev3, motorToTest)
+%executeMotorCmd Assigns the parameters as values for an EV3 object and
+%tests a given motor
+%   The parameters will be assigned as values for a specific motor object.
+%   The motor will be started, in normal mode or synced with another motor
+%   of the EV3 object.
+
+
+motorToTest.limitValue = limitValue;
+motorToTest.limitMode = limitMode;
+motorToTest.brakeMode = brakeMode;
+motorToTest.speedRegulation = speedRegulation;
+motorToTest.power = power;
+
+if ((~syncedMode) || (strcmp(motorToTest.type, 'MediumMotor')))
+    motorToTest.start();
+else
+    if strcmp(char(ev3.motorA.type), 'LargeMotor') && (ev3.motorA.limitValue ~= motorToTest.limitValue)
+        motorToTest.syncedStart(ev3.motorA)        
+    end%if
+    if strcmp(char(ev3.motorB.type), 'LargeMotor') && (ev3.motorB.limitValue ~= motorToTest.limitValue)
+        motorToTest.syncedStart(ev3.motorB)
+     end%if
+    if strcmp(char(ev3.motorC.type), 'LargeMotor') && (ev3.motorC.limitValue ~= motorToTest.limitValue)
+        motorToTest.syncedStart(ev3.motorC)
+    end%if
+    if strcmp(char(ev3.motorD.type), 'LargeMotor') && (ev3.motorD.limitValue ~= motorToTestlimitValue)
+        motorToTest.syncedStart(ev3.motorD)        
+    end%if
+end%if
+end%function
\ No newline at end of file
diff --git a/tests/generateRandomMotorParams.m b/tests/generateRandomMotorParams.m
new file mode 100644
index 0000000000000000000000000000000000000000..5905e9ad61a1fcba3202e3edb709319fefe846fd
--- /dev/null
+++ b/tests/generateRandomMotorParams.m
@@ -0,0 +1,38 @@
+function [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams
+%generateRandomMotorParams Generates random values for a motor
+%   Generates and returns random values for tachoLimit, limitMode, brakeMode,
+%   speedRegulation, power and syncedMode.
+
+
+limitValue = int64(200 + 1000*rand());
+
+limitModeNum = round(rand());
+if limitModeNum == 0
+    limitMode = 'Tacho';
+else
+    limitMode = 'Time';
+end;
+
+brakeModeNum = round(rand());
+if brakeModeNum == 0
+    brakeMode = 'Brake';
+else
+    brakeMode = 'Coast';
+end;
+
+speedRegulation = round(rand());
+
+while true
+    power = int64(rand()*200-100);
+    if power <= -10 || power >= 10
+        break;
+    end%if
+end%while
+
+if speedRegulation == 0
+    syncedMode = round(rand());
+else
+    syncedMode = 0;
+end%if
+
+end%function
\ No newline at end of file
diff --git a/tests/linusM1.m b/tests/linusM1.m
new file mode 100644
index 0000000000000000000000000000000000000000..d15389a18d38e374bab555f4c3379d11f12f6c6d
--- /dev/null
+++ b/tests/linusM1.m
@@ -0,0 +1,8 @@
+function linusM1(m)
+    m.brakeMode = 'Brake';
+    m.limitValue = 5000;
+    m.power = 60;
+    m.limitMode = 'Tacho';
+    m.start();
+
+    
\ No newline at end of file
diff --git a/tests/linusM2.m b/tests/linusM2.m
new file mode 100644
index 0000000000000000000000000000000000000000..026f250596083082c209231b7d213f97bbf57d23
--- /dev/null
+++ b/tests/linusM2.m
@@ -0,0 +1,8 @@
+function linusM2(m)
+    m.brakeMode = 'Coast';
+    m.limitValue = 0;
+    m.power = 30;
+    m.limitMode = 'Tacho';
+    m.start();
+
+    
\ No newline at end of file
diff --git a/tests/motorProblemStart.m b/tests/motorProblemStart.m
new file mode 100644
index 0000000000000000000000000000000000000000..658047e6ea451b9be281e32fd2db36c3c398fd83
--- /dev/null
+++ b/tests/motorProblemStart.m
@@ -0,0 +1,32 @@
+function motorProblemStart()
+% Call this multiple times, then one of the three movements will fail.
+
+brick = EV3();
+brick.connect('usb');
+%brick.debug = 2;
+
+motor = brick.motorA;
+motor.setProperties('power',30,'limitMode', 'Tacho', 'limitValue', 1000, 'brakeMode', 'Coast')
+
+figure; hold all;
+for power=30:20:70
+    motor.power = power;
+    motor.resetTachoCount();
+    % Problem: sometimes, the start command is ignored
+    motor.start;
+    
+    tic
+    t = toc;
+    tVec = []; tachoVec = [];
+    while t < 6
+       t = toc;
+       tVec = [tVec, t]; %#ok<AGROW>
+       tachoVec = [tachoVec, motor.tachoCount]; %#ok<AGROW>
+    end
+    motor.waitFor();
+    plot(tVec,tachoVec); drawnow;
+end
+brick.disconnect();
+
+end
+
diff --git a/tests/motorProblemStartScript.m b/tests/motorProblemStartScript.m
new file mode 100644
index 0000000000000000000000000000000000000000..8d543ba820386e3919653c29e616b2384afb647d
--- /dev/null
+++ b/tests/motorProblemStartScript.m
@@ -0,0 +1,3 @@
+for i=1:10
+    motorProblemStart(); 
+end
\ No newline at end of file
diff --git a/tests/motorProblemWaitfor.m b/tests/motorProblemWaitfor.m
new file mode 100644
index 0000000000000000000000000000000000000000..3cec2149d0312a61861904b09a058d61b652d34a
--- /dev/null
+++ b/tests/motorProblemWaitfor.m
@@ -0,0 +1,22 @@
+function motorProblemWaitfor( )
+% This function will provoke an error in the destructor (at line 14).
+
+brick = EV3();
+%brick.connect('usb');
+brick.connect('bt', 'serPort', '/dev/rfcomm0');
+motor = brick.motorA;
+
+motor.setProperties('power',30,'limitMode', 'Tacho', 'limitValue', 1000, 'brakeMode', 'Coast')
+motor.resetTachoCount();
+motor.start;
+% Problem
+motor.waitFor(); %this does not account for coasting
+% % Solution to the problem
+% while motor.currentSpeed > 0
+% end
+
+
+brick.beep;
+brick.disconnect();
+end
+
diff --git a/tests/packetsPerSecond.m b/tests/packetsPerSecond.m
new file mode 100644
index 0000000000000000000000000000000000000000..2ef83d07009242fba63ce2a2642d8b81d21219b1
--- /dev/null
+++ b/tests/packetsPerSecond.m
@@ -0,0 +1,17 @@
+function packetsPerSecond(brick)
+    MAX_ITERATIONS = 100;
+    
+    dt = [];
+    tic;
+    for i=1:MAX_ITERATIONS
+        temp = brick.inputReadSI(0, 16, 0);
+        dt = [dt, toc];
+    end
+    
+    transmission = diff(dt);
+    meanTransmission = mean(transmission);
+    
+    fprintf('Mean transmission: %.4fs (+- %.4fs)\n', meanTransmission, std(transmission));
+    fprintf('-> ~ %d packets per second\n', int32(1/meanTransmission));
+end
+
diff --git a/tests/plotBusyFlag.m b/tests/plotBusyFlag.m
new file mode 100644
index 0000000000000000000000000000000000000000..1bbff24993c5e40bada9fc92536322eaa9694c42
--- /dev/null
+++ b/tests/plotBusyFlag.m
@@ -0,0 +1,77 @@
+function plotBusyFlag(brick, varargin)
+    p = inputParser();
+    
+    powerValid = @(x) (x>=-100 && x <= 100);
+    limitValid = @(x) (x>=0);
+    
+    p.addOptional('power', 50);
+    p.addOptional('limitValue', 3*360);
+    p.addOptional('speedRegulation', false);
+    p.addOptional('smoothStart', 0);
+    p.addOptional('smoothStop', 0);
+    p.addOptional('brakeMode', 'coast');
+    p.addOptional('limitMode', 'Tacho');
+    p.addOptional('synced', false);
+    
+    p.parse(varargin{:});
+    synced = p.Results.synced;
+    
+%     if ~isDeviceValid('EV3', brick) || ~brick.isConnected
+%         error('Given object is not a connected EV3-object.'); 
+%     end
+    
+    ma = brick.motorA;
+    mb = brick.motorB;
+    
+    ma.resetTachoCount;
+    if synced
+        mb.resetTachoCount;
+    end
+    ma.setProperties('power', p.Results.power, 'brakeMode', p.Results.brakeMode, ...
+                     'limitMode', p.Results.limitMode, 'limitValue', p.Results.limitValue, ...
+                     'smoothStart', p.Results.smoothStart, ...
+                     'smoothStop', p.Results.smoothStop, ...
+                     'speedRegulation', p.Results.speedRegulation);
+    
+    t = [];
+    flag = [];
+    tacho = [];
+    
+    stopSent = false;
+    stopTime = 0;
+    if ~synced
+        tic;
+        ma.start();
+        while(toc < 10)
+            flag = [flag, ma.isRunning];
+            tacho = [tacho, ma.tachoCount];
+            t = [t, toc];
+        end
+        if ma.limitValue == 0
+            ma.stop();
+        end
+        tacho = [tacho, ma.tachoCount];
+        flag = [flag, ma.isRunning];
+        t = [t, toc];
+    else
+        tic;
+        ma.syncedStart(mb);
+        while(toc < 10)
+            flag = [flag, ma.isRunning];
+            tacho = [tacho, ma.tachoCount];
+            t = [t, toc];
+            if ma.limitValue == 0
+                if (~stopSent && toc > 8)
+                    stopTime = toc;
+                    ma.syncedStop();
+                    stopSent = true;
+                end
+            end
+        end
+    end
+    hold all
+    plot(t,tacho,t,max(tacho)*int32(flag),'-.or')  
+    %plot([stopTime stopTime],[0 1000], '.-m')  
+
+    grid on
+end
\ No newline at end of file
diff --git a/tests/plotHTGyro.m b/tests/plotHTGyro.m
new file mode 100644
index 0000000000000000000000000000000000000000..17f582a013faa9687d0b88fd650605351953db42
--- /dev/null
+++ b/tests/plotHTGyro.m
@@ -0,0 +1,24 @@
+b = EV3();
+b.connect('bt', 'serPort', '/dev/rfcomm0');
+
+
+t = [];
+val = [];
+
+stopSent = false;
+stopTime = 0;
+s = b.sensor1;
+
+tic;
+while(toc < 10)
+    val = [val, s.value];
+    t = [t, toc];
+end
+val = [val, s.value];
+t = [t, toc];
+    
+hold all
+plot(t,val,'-.or')  
+%plot([stopTime stopTime],[0 1000], '.-m')  
+
+grid on
\ No newline at end of file
diff --git a/tests/randomMotorTestPlot.m b/tests/randomMotorTestPlot.m
new file mode 100644
index 0000000000000000000000000000000000000000..7d9b7b904d4fa6bf85bcfb13ca2e0f5bf46d1387
--- /dev/null
+++ b/tests/randomMotorTestPlot.m
@@ -0,0 +1,81 @@
+function [] = randomMotorTestPlot
+%testMotor Random test for motors
+%   Starts N times the motor motorToTest of the object ev3
+
+%Variablen bitte anpassen
+clear all;
+brick=EV3;
+brick.connect('bt', 'serPort', '/dev/rfcomm0');
+motorToTest = brick.motorC;
+TIMEOUT_SEC = 20.0;
+N = 10;
+
+% %Initialisiere Plot
+% tic;
+% plotIsRunning = [];
+% plotPower = [];
+% plotTachoCount = [];
+% plotCurrentSpeed = [];
+% time = [];
+% figure;
+% grid on;
+% %legend('isRunning', 'power', 'tachoCount', 'currentSpeed');
+
+%Schleifendurchlauf
+for j = 1 : N
+
+    [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams;
+    executeMotorCmd(limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode, brick, motorToTest);
+    motorToTest
+    disp(syncedMode)
+    
+    
+    
+    while motorToTest.isRunning
+        
+    end%while
+    
+    
+    
+%     hTimeout = tic();
+%     timeoutHappened = false;
+%     while (motorToTest.isRunning())
+%         
+%         if (toc(hTimeout) > TIMEOUT_SEC)
+%             timeoutHappened = true;
+%             break;
+%         end%if
+% 
+%         %update plot
+%         time = [time, toc];
+%         plotIsRunning = 1;
+%         plotPower = [plotPower, motorToTest.power];
+%         %plotTachoCount = [plotTachoCount, motorToTest.tachoCount/100];
+%         %plotCurrentSpeed = [plotCurrentSpeed, motorToTest.currentSpeed*10];
+%         plot(time, plotIsRunning, time, plotPower);
+%         %legend('isRunning', 'power', 'tachoCount', 'currentSpeed');
+%         drawnow;
+% 
+%     end%while
+% 
+%    % optional: update plot
+% %     time = [time, toc];
+% %     plotIsRunning = 0;
+% %     plotPower = [plotPower, motorToTest.power];
+% %     plotTachoCount = [plotTachoCount, motorToTest.tachoCount/100];
+% %     plotCurrentSpeed = [plotCurrentSpeed, motorToTest.currentSpeed*10];
+% %     plot(time, plotIsRunning, time, plotCurrentSpeed, time, plotPower, time, plotTachoCount);
+% %     drawnow;
+% 
+%     if timeoutHappened
+%         warning('Timeout happened');
+%     end%if
+%     
+%     pause(1.0);
+    
+end%for
+
+brick.disconnect;
+clear all;
+
+end%function
diff --git a/tests/readAllSensors.m b/tests/readAllSensors.m
new file mode 100644
index 0000000000000000000000000000000000000000..af933fc196e80b0fb4dd814e85b1210f486f54af
--- /dev/null
+++ b/tests/readAllSensors.m
@@ -0,0 +1,23 @@
+function [port1, port2, port3, port4] = readAllSensors(varargin)
+
+b = CommunicationInterface(varargin{:});
+
+mode = 0;
+
+cmd = Command();
+cmd.addHeaderDirectReply(42,4*4,0);
+cmd.opINPUT_READSI(0,SensorPort.Sensor1,0,0,0);
+cmd.opINPUT_READSI(0,SensorPort.Sensor2,0,0,4);
+cmd.opINPUT_READSI(0,SensorPort.Sensor3,0,0,8);
+cmd.opINPUT_READSI(0,SensorPort.Sensor4,0,0,12);
+cmd.addLength();
+b.send(cmd);
+msg = b.receive()';
+
+port1 = typecast(uint8(msg(6:9)),'single');
+port2 = typecast(uint8(msg(10:13)),'single');
+port3 = typecast(uint8(msg(14:17)),'single');
+port4 = typecast(uint8(msg(18:21)),'single');
+
+end
+
diff --git a/tests/test4.m b/tests/test4.m
new file mode 100644
index 0000000000000000000000000000000000000000..fc428f8056d36a42af49fd43638c133733c1c318
--- /dev/null
+++ b/tests/test4.m
@@ -0,0 +1,8 @@
+function test4(power, limit, motor)
+    motor.limitValue = limit;
+    motor.power = power;
+    motor.start();
+    motor.waitFor;
+end
+
+
diff --git a/tests/test5.m b/tests/test5.m
new file mode 100644
index 0000000000000000000000000000000000000000..f689f2be905bf20aac68607391d7dee7b8114c61
--- /dev/null
+++ b/tests/test5.m
@@ -0,0 +1,10 @@
+b = EV3();
+b.connect('bt', 'serPort', '/dev/rfcomm0');
+ma = b.motorA;
+mb = b.motorB;
+s4 = b.sensor4;
+ma.setProperties('power', 20);
+mb.setProperties('power', 20);
+
+ma.syncedStart(mb);
+
diff --git a/tests/testAccSensor b/tests/testAccSensor
new file mode 100644
index 0000000000000000000000000000000000000000..266418cc59cd5fdc0cb66e01d5cd37d17378f281
--- /dev/null
+++ b/tests/testAccSensor
@@ -0,0 +1,8 @@
+b = CommunicationInterface('usb');
+b.debug = 1;
+
+v = 0;
+for i=1:100
+    v = [v, b.inputReadSI(0, SensorPort.Sensor1, DeviceMode.HTAccelerometer.AccelerationAllAxes)];
+end
+
diff --git a/tests/testAccSensor.m b/tests/testAccSensor.m
new file mode 100644
index 0000000000000000000000000000000000000000..266418cc59cd5fdc0cb66e01d5cd37d17378f281
--- /dev/null
+++ b/tests/testAccSensor.m
@@ -0,0 +1,8 @@
+b = CommunicationInterface('usb');
+b.debug = 1;
+
+v = 0;
+for i=1:100
+    v = [v, b.inputReadSI(0, SensorPort.Sensor1, DeviceMode.HTAccelerometer.AccelerationAllAxes)];
+end
+
diff --git a/tests/testIssue25.m b/tests/testIssue25.m
new file mode 100644
index 0000000000000000000000000000000000000000..050989b399b040c23acbd2047bac0bc7b965f204
--- /dev/null
+++ b/tests/testIssue25.m
@@ -0,0 +1,29 @@
+b = EV3();
+b.connect('bt', 'serPort', '/dev/rfcomm0');
+
+motorR = b.motorA;
+motorL = b.motorC;
+
+motorR.setProperties('power', 100, 'limitValue', 850, 'speedRegulation', true);
+motorL.setProperties('power', -100, 'limitValue', 850, 'speedRegulation', true);
+
+motorL.start();
+motorR.start();
+
+pause(1);
+motorL.waitFor();
+
+motorR.speedRegulation = 'Off';
+
+% move out of box
+motorL.speedRegulation = 'Off'; % notwendig, sonst auch Fehlermeldung
+while motorL.currentSpeed ~= 0
+    pause(0.1); 
+end
+
+motorL.power = -motorL.power;
+motorR.power = -motorL.power;
+
+motorL.limitValue = 360;
+motorL.brakeMode = 'brake';
+motorL.syncedStart(motorR);
\ No newline at end of file
diff --git a/tests/testMotor.m b/tests/testMotor.m
new file mode 100644
index 0000000000000000000000000000000000000000..6892f0981afbaa94f05c70716d7ec0660b17e089
--- /dev/null
+++ b/tests/testMotor.m
@@ -0,0 +1,40 @@
+clear all
+
+brickObject = EV3();
+brickObject.connect('bt', 'serPort', '/dev/rfcomm0');
+
+frate = 2.25;
+dist = [];
+ang = [];
+ma = brickObject.motorA;
+mb = brickObject.motorB;
+ma.limitValue = 0; %Dummywert
+mb.limitValue = 0; %Dummywert
+ma.power = 30;
+mb.power = -30;
+
+ma.limitValue = 1000; %Dummywert
+mb.limitValue = 1000; %Dummywert
+ma.smoothStart = 30;
+ma.smoothStop = 30;
+mb.smoothStart = 30;
+mb.smoothStop = 30;
+ma.resetTachoCount;
+mb.resetTachoCount;
+ma.brakeMode = 'Brake';
+mb.brakeMode = 'Brake';
+
+ma.limitValue = 360*frate;
+mb.limitValue = 360*frate;
+ma.start();
+mb.start();
+pause(0.5);
+while mb.isRunning
+    ma.tachoCount
+    a = ma.tachoCount / frate;
+    d = brickObject.sensor4.value;
+    ang = [ang a];
+    dist = [dist d];
+end
+dist = min(150,dist);
+polar(single(ang)/180.*pi,dist);
\ No newline at end of file
diff --git a/tests/testToolbox.m b/tests/testToolbox.m
new file mode 100644
index 0000000000000000000000000000000000000000..1908fb131eaf2f5bcd80bd2ab5c9e477f9485895
--- /dev/null
+++ b/tests/testToolbox.m
@@ -0,0 +1,44 @@
+clear all
+
+b = EV3();
+b.connect('serPort', '/dev/rfcomm0');
+b.sensor3.mode = DeviceMode.Color.Col;
+b.sensor4.mode = DeviceMode.UltraSonic.DistCM;
+tic;
+t = 0;
+
+b.motorA.setProperties('power', 50, 'speedRegulation', 'on', 'smoothStart', 10, 'limitMode', ...
+    'Time', 'limitValue', 3000);
+b.motorA.start();
+
+pause(0.5);
+while b.motorA.isRunning()
+    b.sensor3.value
+    b.sensor4.value
+    b.motorA.tachoCount
+end
+
+b.motorB.power = 50;
+b.motorB.limitValue = 4*360;
+b.motorB.start();
+b.motorB.waitFor();
+b.beep();
+
+b.motorA.speedRegulation = false;
+pause(1);
+b.motorA.syncedStart(b.motorB, 'turnRatio', 200);
+b.motorA.waitFor();
+
+for i=1:10
+    b.sensor3.value
+    b.motorA.tachoCount
+    b.sensor3.reset
+    b.motorA.tachoCount
+end
+
+b.beep
+b.beep
+
+
+b.disconnect
+b.delete
\ No newline at end of file
diff --git a/tests/testUSBSpeed.m b/tests/testUSBSpeed.m
new file mode 100644
index 0000000000000000000000000000000000000000..ef072ac67f2a625e57074c407c4285032c79a24e
--- /dev/null
+++ b/tests/testUSBSpeed.m
@@ -0,0 +1,16 @@
+clear all;
+
+b = EV3();
+b.connect('bt', 'serPort', '/dev/rfcomm1');
+%b = CommunicationInterface('bt', 'serPort', '/dev/rfcomm1');
+
+p = 0;
+tic;
+while toc < 10
+    temp = b.sensor1.value;
+    p = p+1;
+end
+
+fprintf('Packets per second: %.2f\n', p / 10.0);
+
+clear all;
\ No newline at end of file
diff --git a/tests/valuesPerSecond.m b/tests/valuesPerSecond.m
new file mode 100644
index 0000000000000000000000000000000000000000..10560b4539935421d76b4aef9abdf33c0d9cb159
--- /dev/null
+++ b/tests/valuesPerSecond.m
@@ -0,0 +1,16 @@
+function valuesPerSecond(brick) 
+    MAX_ITERATIONS = 100;
+    
+    dt = [];
+    tic;
+    for i=1:MAX_ITERATIONS
+        temp = brick.motorA.tachoCount;
+        dt = [dt, toc];
+    end
+    
+    transmission = diff(dt);
+    meanTransmission = mean(transmission);
+    
+    fprintf('Mean transmission: %.4fs (+- %.4fs)\n', meanTransmission, std(transmission));
+    fprintf('-> ~ %d values per second\n', int32(1/meanTransmission));
+end
\ No newline at end of file
diff --git a/tools/private/executeMotorCmd.m b/tools/private/executeMotorCmd.m
new file mode 100644
index 0000000000000000000000000000000000000000..d27fbc9ef0e6053961b6b1b1902b2f349bca11c6
--- /dev/null
+++ b/tools/private/executeMotorCmd.m
@@ -0,0 +1,31 @@
+function [] = executeMotorCmd(limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode, ev3, motorToTest)
+%executeMotorCmd Assigns the parameters as values for an EV3 object and
+%tests a given motor
+%   The parameters will be assigned as values for a specific motor object.
+%   The motor will be started, in normal mode or synced with another motor
+%   of the EV3 object.
+
+
+motorToTest.limitValue = limitValue;
+motorToTest.limitMode = limitMode;
+motorToTest.brakeMode = brakeMode;
+motorToTest.speedRegulation = speedRegulation;
+motorToTest.power = power;
+
+if ((~syncedMode) || (strcmp(motorToTest.type, 'MediumMotor')))
+    motorToTest.start();
+else
+    if strcmp(char(ev3.motorA.type), 'LargeMotor') && (ev3.motorA.limitValue ~= motorToTest.limitValue)
+        motorToTest.syncedStart(ev3.motorA)        
+    end%if
+    if strcmp(char(ev3.motorB.type), 'LargeMotor') && (ev3.motorB.limitValue ~= motorToTest.limitValue)
+        motorToTest.syncedStart(ev3.motorB)
+     end%if
+    if strcmp(char(ev3.motorC.type), 'LargeMotor') && (ev3.motorC.limitValue ~= motorToTest.limitValue)
+        motorToTest.syncedStart(ev3.motorC)
+    end%if
+    if strcmp(char(ev3.motorD.type), 'LargeMotor') && (ev3.motorD.limitValue ~= motorToTestlimitValue)
+        motorToTest.syncedStart(ev3.motorD)        
+    end%if
+end%if
+end%function
\ No newline at end of file
diff --git a/tools/private/generateRandomMotorParams.m b/tools/private/generateRandomMotorParams.m
new file mode 100644
index 0000000000000000000000000000000000000000..5905e9ad61a1fcba3202e3edb709319fefe846fd
--- /dev/null
+++ b/tools/private/generateRandomMotorParams.m
@@ -0,0 +1,38 @@
+function [limitValue, limitMode, brakeMode, speedRegulation, power, syncedMode] = generateRandomMotorParams
+%generateRandomMotorParams Generates random values for a motor
+%   Generates and returns random values for tachoLimit, limitMode, brakeMode,
+%   speedRegulation, power and syncedMode.
+
+
+limitValue = int64(200 + 1000*rand());
+
+limitModeNum = round(rand());
+if limitModeNum == 0
+    limitMode = 'Tacho';
+else
+    limitMode = 'Time';
+end;
+
+brakeModeNum = round(rand());
+if brakeModeNum == 0
+    brakeMode = 'Brake';
+else
+    brakeMode = 'Coast';
+end;
+
+speedRegulation = round(rand());
+
+while true
+    power = int64(rand()*200-100);
+    if power <= -10 || power >= 10
+        break;
+    end%if
+end%while
+
+if speedRegulation == 0
+    syncedMode = round(rand());
+else
+    syncedMode = 0;
+end%if
+
+end%function
\ No newline at end of file