first commit
432
docs/404.html
Normal file
|
|
@ -0,0 +1,432 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="/GrovePi/img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/GrovePi/assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/GrovePi/assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/GrovePi/assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
<h1>404 - Not found</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="/GrovePi/assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/GrovePi/assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"/GrovePi"}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1064
docs/api/complex/index.html
Normal file
724
docs/api/general/index.html
Normal file
|
|
@ -0,0 +1,724 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/api/general/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>General Sensors - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#api-general-sensors" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
General Sensors
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../.." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" checked>
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
General Sensors
|
||||
</label>
|
||||
|
||||
<a href="./" title="General Sensors" class="md-nav__link md-nav__link--active">
|
||||
General Sensors
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepitemppin-model10" title="grovepi.temp(pin, model='1.0')" class="md-nav__link">
|
||||
grovepi.temp(pin, model='1.0')
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiultrasonicreadpin" title="grovepi.ultrasonicRead(pin)" class="md-nav__link">
|
||||
grovepi.ultrasonicRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiversion" title="grovepi.version()" class="md-nav__link">
|
||||
grovepi.version()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidhtpin-module_type" title="grovepi.dht(pin, module_type)" class="md-nav__link">
|
||||
grovepi.dht(pin, module_type)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_read_signal" title="grovepi.ir_read_signal()" class="md-nav__link">
|
||||
grovepi.ir_read_signal()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_recv_pinpin" title="grovepi.ir_recv_pin(pin)" class="md-nav__link">
|
||||
grovepi.ir_recv_pin(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_is_data" title="grovepi.ir_is_data()" class="md-nav__link">
|
||||
grovepi.ir_is_data()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepitemppin-model10" title="grovepi.temp(pin, model='1.0')" class="md-nav__link">
|
||||
grovepi.temp(pin, model='1.0')
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiultrasonicreadpin" title="grovepi.ultrasonicRead(pin)" class="md-nav__link">
|
||||
grovepi.ultrasonicRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiversion" title="grovepi.version()" class="md-nav__link">
|
||||
grovepi.version()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidhtpin-module_type" title="grovepi.dht(pin, module_type)" class="md-nav__link">
|
||||
grovepi.dht(pin, module_type)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_read_signal" title="grovepi.ir_read_signal()" class="md-nav__link">
|
||||
grovepi.ir_read_signal()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_recv_pinpin" title="grovepi.ir_recv_pin(pin)" class="md-nav__link">
|
||||
grovepi.ir_recv_pin(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_is_data" title="grovepi.ir_is_data()" class="md-nav__link">
|
||||
grovepi.ir_is_data()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/api/general.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="api-general-sensors">API - General Sensors<a class="headerlink" href="#api-general-sensors" title="Permanent link">¶</a></h1>
|
||||
<p>In this section the Python API reference for diverse sensors is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.</p>
|
||||
<p>In this section, the API for the following sensors is described:</p>
|
||||
<ul>
|
||||
<li><a href="http://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/">Grove Temperature Sensor</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html">Grove Ultrasonic Sensor</a></li>
|
||||
<li><a href="http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/">DHT11</a></li>
|
||||
<li><a href="http://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/">DHT22</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a> necessary for the <a href="https://www.dexterindustries.com/shop/infrared-remote/">Infrared Remote</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<p><strong>IMPORTANT</strong></p>
|
||||
<p>This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.</p>
|
||||
<p>In case you need to reset the GrovePi from your Raspberry Pi, <a href="../fw/#resetting-the-grovepi">check this section</a>.</p>
|
||||
<p>The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.</p>
|
||||
<hr />
|
||||
<h2 id="grovepitemppin-model10"><code>grovepi.temp(pin, model='1.0')</code><a class="headerlink" href="#grovepitemppin-model10" title="Permanent link">¶</a></h2>
|
||||
<p>Read temperature from the <a href="http://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/">Grove Temperature Sensor</a> on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (A0-A2) from which to do the reading</li>
|
||||
<li><code>model {String}</code> <code>"1.0"</code>, <code>"1.1"</code>, <code>"1.2"</code> depending on the used model</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Float}</code> number to represent the temperature in ºC</p>
|
||||
<hr />
|
||||
<h2 id="grovepiultrasonicreadpin"><code>grovepi.ultrasonicRead(pin)</code><a class="headerlink" href="#grovepiultrasonicreadpin" title="Permanent link">¶</a></h2>
|
||||
<p>Read the distance to an object with the <a href="https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html">Grove Ultrasonic Sensor</a> on the GrovePi.
|
||||
The closer it is to the targeted object, the faster the sample rate and slower when it's farther.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) from which to do the reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Integer}</code> number to represent the distance to the object in centimeters</p>
|
||||
<hr />
|
||||
<h2 id="grovepiversion"><code>grovepi.version()</code><a class="headerlink" href="#grovepiversion" title="Permanent link">¶</a></h2>
|
||||
<p>Read the version of the firmware.</p>
|
||||
<p><strong>Returns</strong>: a <code>{String}</code> representing the firmware version (i.e. <code>"1.2.7"</code>)</p>
|
||||
<hr />
|
||||
<h2 id="grovepidhtpin-module_type"><code>grovepi.dht(pin, module_type)</code><a class="headerlink" href="#grovepidhtpin-module_type" title="Permanent link">¶</a></h2>
|
||||
<p>Read the temperature and humidity on the GrovePi with one of the given modules.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) from which to do the reading</li>
|
||||
<li>
|
||||
<p><code>module_type {Integer}</code> a number to identify the model</p>
|
||||
<ul>
|
||||
<li><code>0</code> for <a href="http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/">DHT11</a></li>
|
||||
<li><code>1</code> for <a href="http://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/">DHT22</a></li>
|
||||
<li><code>2</code> for DHT21</li>
|
||||
<li><code>3</code> for AM2301</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: a <code>{(Float, Float}</code> list where the 1st parameter is the temperature in ºC and the 2nd one is the humidity as a percentage.</p>
|
||||
<p><strong>On Error</strong>: it returns a <code>{(Float, Float)}</code> list containing <code>NaN</code>s. This happens when the sensor can't keep up with the demanded sample rate.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiir_read_signal"><code>grovepi.ir_read_signal()</code><a class="headerlink" href="#grovepiir_read_signal" title="Permanent link">¶</a></h2>
|
||||
<p>Get the decoded value from the <a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a>. For this you need to use a remote control of any kind. The preferred one we use is the <a href="https://www.dexterindustries.com/shop/infrared-remote/">Infrared Remote</a>.</p>
|
||||
<p>In order to use this function, you first need to call <a href="#grovepiir_recv_pinpin">grovepi.ir_recv_pin</a> function to bind the functionality to a given port.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: a 3-element list of this form <code>{(Integer, Integer, Integer)}</code></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>The 1st element keeps an <code>{Integer}</code> corresponding to a certain brand:</p>
|
||||
<ul>
|
||||
<li><code>-1</code> for unknown and <code>0</code> for unused</li>
|
||||
<li>RC2, RC5, NEC, SONY, PANASONIC, JVC, SAMSUNG, WHYNTER, AIWA_RC_T501, LG, SANYO, MITSUBISHI, DISH, SHARP, DENON, PRONTO, LEGO_PF having values from <code>1</code> to <code>17</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>The 2nd element is a 16-bit address used by some Panasonic and Sharp remotes</p>
|
||||
</li>
|
||||
<li>The 3rd element is the 32-bit decoded value that can be used to identify which buttons were pressed - since there's no map for them you need to do it on a case-by-case basis</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h2 id="grovepiir_recv_pinpin"><code>grovepi.ir_recv_pin(pin)</code><a class="headerlink" href="#grovepiir_recv_pinpin" title="Permanent link">¶</a></h2>
|
||||
<p>Enable the <a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a> on a given port. Used in conjunction with <a href="#grovepiir_read_signal">grovepi.ir_read_signal</a> and <a href="#grovepiir_is_data">grovepi.ir_is_data</a>.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> The port (D2-D8) to which the IR receiver gets connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiir_is_data"><code>grovepi.ir_is_data()</code><a class="headerlink" href="#grovepiir_is_data" title="Permanent link">¶</a></h2>
|
||||
<p>Checks if there's available data coming from the <a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a>. Used in conjunction with <a href="#grovepiir_read_signal">grovepi.ir_read_signal</a> function.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: <code>True</code> or <code>False</code></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../gpio/" title="GPIO Functions" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
GPIO Functions
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../complex/" title="Complex Devices" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Complex Devices
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
659
docs/api/gpio/index.html
Normal file
|
|
@ -0,0 +1,659 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/api/gpio/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>GPIO Functions - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#api-gpio-functions" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
GPIO Functions
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../.." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" checked>
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
GPIO Functions
|
||||
</label>
|
||||
|
||||
<a href="./" title="GPIO Functions" class="md-nav__link md-nav__link--active">
|
||||
GPIO Functions
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalreadpin" title="grovepi.digitalRead(pin)" class="md-nav__link">
|
||||
grovepi.digitalRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalwritepin-value" title="grovepi.digitalWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.digitalWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogreadpin" title="grovepi.analogRead(pin)" class="md-nav__link">
|
||||
grovepi.analogRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogwritepin-value" title="grovepi.analogWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.analogWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepipinmodepin-mode" title="grovepi.pinMode(pin, mode)" class="md-nav__link">
|
||||
grovepi.pinMode(pin, mode)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalreadpin" title="grovepi.digitalRead(pin)" class="md-nav__link">
|
||||
grovepi.digitalRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalwritepin-value" title="grovepi.digitalWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.digitalWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogreadpin" title="grovepi.analogRead(pin)" class="md-nav__link">
|
||||
grovepi.analogRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogwritepin-value" title="grovepi.analogWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.analogWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepipinmodepin-mode" title="grovepi.pinMode(pin, mode)" class="md-nav__link">
|
||||
grovepi.pinMode(pin, mode)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/api/gpio.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="api-gpio-functions">API - GPIO Functions<a class="headerlink" href="#api-gpio-functions" title="Permanent link">¶</a></h1>
|
||||
<p>In this section the Python API reference for GPIO functions is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.</p>
|
||||
<hr />
|
||||
<p><strong>IMPORTANT</strong></p>
|
||||
<p>This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.</p>
|
||||
<p>In case you need to reset the GrovePi from your Raspberry Pi, <a href="../fw/#resetting-the-grovepi">check this section</a>.</p>
|
||||
<p>The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.</p>
|
||||
<hr />
|
||||
<h2 id="grovepidigitalreadpin"><code>grovepi.digitalRead(pin)</code><a class="headerlink" href="#grovepidigitalreadpin" title="Permanent link">¶</a></h2>
|
||||
<p>Reads whether a port's input is set high or low on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) from which to do the reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>0</code> or <code>1</code> depending on the input value</p>
|
||||
<hr />
|
||||
<h2 id="grovepidigitalwritepin-value"><code>grovepi.digitalWrite(pin, value)</code><a class="headerlink" href="#grovepidigitalwritepin-value" title="Permanent link">¶</a></h2>
|
||||
<p>Sets the output value to either <code>0</code> or <code>1</code> to a digital port on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) to which to do the writing</li>
|
||||
<li><code>value {Integer}</code> either <code>0</code> for 0 volts or <code>1</code> for maximum output voltage (usually 5 volts)</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>1</code> all the time</p>
|
||||
<hr />
|
||||
<h2 id="grovepianalogreadpin"><code>grovepi.analogRead(pin)</code><a class="headerlink" href="#grovepianalogreadpin" title="Permanent link">¶</a></h2>
|
||||
<p>Detect an input voltage as a value from a given port on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (A0-A2) from which to do the reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: a 10-bit <code>{Integer}</code> number that maps to the input voltage on the port</p>
|
||||
<hr />
|
||||
<h2 id="grovepianalogwritepin-value"><code>grovepi.analogWrite(pin, value)</code><a class="headerlink" href="#grovepianalogwritepin-value" title="Permanent link">¶</a></h2>
|
||||
<p>Set an output voltage on a PWM-enabled port by mapping the value to the desired voltage on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (ports 3, 5, 6, 9) to which to do the writing</li>
|
||||
<li><code>value {Integer}</code> an 8-bit number that maps from 0V to the referenced voltage of the GrovePi (5V)</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>1</code> all the time</p>
|
||||
<hr />
|
||||
<h2 id="grovepipinmodepin-mode"><code>grovepi.pinMode(pin, mode)</code><a class="headerlink" href="#grovepipinmodepin-mode" title="Permanent link">¶</a></h2>
|
||||
<p>Sets a port to be either an OUTPUT or an INPUT port on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) to which to do the change</li>
|
||||
<li><code>mode {String}</code> <code>"OUTPUT"</code> for writing values or <code>"INPUT"</code> for reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>1</code> all the time</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Hardware Ports
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../general/" title="General Sensors" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
General Sensors
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
914
docs/api/interrupt/index.html
Normal file
|
|
@ -0,0 +1,914 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/api/interrupt/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>Interrupt-Based Devices - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#api-interrupt-based-devices" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Interrupt-Based Devices
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../.." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" checked>
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
Interrupt-Based Devices
|
||||
</label>
|
||||
|
||||
<a href="./" title="Interrupt-Based Devices" class="md-nav__link md-nav__link--active">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period" title="grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)" class="md-nav__link">
|
||||
grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_pin_interruptpin" title="grovepi.unset_pin_interrupt(pin)" class="md-nav__link">
|
||||
grovepi.unset_pin_interrupt(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_all_interrupts" title="grovepi.unset_all_interrupts()" class="md-nav__link">
|
||||
grovepi.unset_all_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiis_interrupt_activepin" title="grovepi.is_interrupt_active(pin)" class="md-nav__link">
|
||||
grovepi.is_interrupt_active(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiget_active_interrupts" title="grovepi.get_active_interrupts()" class="md-nav__link">
|
||||
grovepi.get_active_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiread_interrupt_statepin" title="grovepi.read_interrupt_state(pin)" class="md-nav__link">
|
||||
grovepi.read_interrupt_state(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_enpin-2-period-30000" title="grovepi.dust_sensor_en(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_en(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_dispin-2" title="grovepi.dust_sensor_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.dust_sensor_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_readpin-2-period-30000" title="grovepi.dust_sensor_read(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_read(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_enpin-2-steps-32" title="grovepi.encoder_en(pin = 2, steps = 32)" class="md-nav__link">
|
||||
grovepi.encoder_en(pin = 2, steps = 32)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_dispin-2" title="grovepi.encoder_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoder_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoderreadpin-2" title="grovepi.encoderRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoderRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowenablepin-2-period-2000" title="grovepi.flowEnable(pin = 2, period = 2000)" class="md-nav__link">
|
||||
grovepi.flowEnable(pin = 2, period = 2000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowdisablepin-2" title="grovepi.flowDisable(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowDisable(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowreadpin-2" title="grovepi.flowRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period" title="grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)" class="md-nav__link">
|
||||
grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_pin_interruptpin" title="grovepi.unset_pin_interrupt(pin)" class="md-nav__link">
|
||||
grovepi.unset_pin_interrupt(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_all_interrupts" title="grovepi.unset_all_interrupts()" class="md-nav__link">
|
||||
grovepi.unset_all_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiis_interrupt_activepin" title="grovepi.is_interrupt_active(pin)" class="md-nav__link">
|
||||
grovepi.is_interrupt_active(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiget_active_interrupts" title="grovepi.get_active_interrupts()" class="md-nav__link">
|
||||
grovepi.get_active_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiread_interrupt_statepin" title="grovepi.read_interrupt_state(pin)" class="md-nav__link">
|
||||
grovepi.read_interrupt_state(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_enpin-2-period-30000" title="grovepi.dust_sensor_en(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_en(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_dispin-2" title="grovepi.dust_sensor_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.dust_sensor_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_readpin-2-period-30000" title="grovepi.dust_sensor_read(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_read(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_enpin-2-steps-32" title="grovepi.encoder_en(pin = 2, steps = 32)" class="md-nav__link">
|
||||
grovepi.encoder_en(pin = 2, steps = 32)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_dispin-2" title="grovepi.encoder_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoder_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoderreadpin-2" title="grovepi.encoderRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoderRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowenablepin-2-period-2000" title="grovepi.flowEnable(pin = 2, period = 2000)" class="md-nav__link">
|
||||
grovepi.flowEnable(pin = 2, period = 2000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowdisablepin-2" title="grovepi.flowDisable(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowDisable(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowreadpin-2" title="grovepi.flowRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/api/interrupt.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="api-interrupt-based-devices">API - Interrupt-Based Devices<a class="headerlink" href="#api-interrupt-based-devices" title="Permanent link">¶</a></h1>
|
||||
<p>In this section the Python API reference for interrupt-based devices is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.</p>
|
||||
<p>The API for the following sensors is described in this section:</p>
|
||||
<ul>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a> of whose functionality can be used in other applications too</li>
|
||||
</ul>
|
||||
<p>Apart from describing the API for the above sensors, there is also described a set of functions used to set interrupt events on the GrovePi. These functions are like the building blocks of the API of the above sensors and can be used for your own implementation, should it be applicable to your device.</p>
|
||||
<hr />
|
||||
<p><strong>IMPORTANT</strong></p>
|
||||
<p>This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.</p>
|
||||
<p>In case you need to reset the GrovePi from your Raspberry Pi, <a href="../../fw/#resetting-the-grovepi">check this section</a>.</p>
|
||||
<p>The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiset_pin_interruptpin-ftype-interrupt_mode-period"><code>grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)</code><a class="headerlink" href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period" title="Permanent link">¶</a></h2>
|
||||
<p>Attach an interrupt event to a port.</p>
|
||||
<p>Can be used to count pulses, duration of pulses, set different kinds of trigger modes (on change, rising or falling edges) all done within a given time period.</p>
|
||||
<p>If there are subsequent calls to this set function without detaching the interrupt event first from a given pin, then it will overwrite the old setting and update it to reflect the latest one.</p>
|
||||
<p>Also, setting this up disables the OUTPUT functionality on the selected pin. If the selected pin has to drive the output, then detach the interrupt event with <a href="#grovepiunset_pin_interruptpin">grovepi.unset_pin_interrupt</a>.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> can be pins D2-D8 to which the device is connected to</li>
|
||||
<li><code>ftype {Integer}</code> the type of event/operation associated for the given pin. Can take values <code>grovepi.COUNT_CHANGES</code> (for counting the number of triggers) or <code>grovepi.COUNT_LOW_DURATION</code> (which measures how much time the signal stays low in a given period).</li>
|
||||
<li><code>interrupt_mode {Integer}</code> triggering mode of the interrupt. It can be <code>grovepi.CHANGE</code>, <code>grovepi.FALLING</code> or <code>grovepi.RISING</code>, just like on the Arduino.</li>
|
||||
<li><code>period {Integer}</code> specifying after how long the recorded value should be stored on the GrovePi to be subsequently read on the master device (Raspberry Pi). Measured in milliseconds. Minimum value shouldn't be too small (say under <em>5 ms</em>) and the maximum value is <em>65535 ms</em>.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiunset_pin_interruptpin"><code>grovepi.unset_pin_interrupt(pin)</code><a class="headerlink" href="#grovepiunset_pin_interruptpin" title="Permanent link">¶</a></h2>
|
||||
<p>Detach an interrupt event from a given pin.</p>
|
||||
<p>Necessary if you want to set output values to this pin with <a href="../gpio/#grovepidigitalwritepin-value">grovepi.digitalWrite</a> function.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> pins D2-D8 from which the interrupt is released from</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiunset_all_interrupts"><code>grovepi.unset_all_interrupts()</code><a class="headerlink" href="#grovepiunset_all_interrupts" title="Permanent link">¶</a></h2>
|
||||
<p>Detach all active interrupt events on all pins.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiis_interrupt_activepin"><code>grovepi.is_interrupt_active(pin)</code><a class="headerlink" href="#grovepiis_interrupt_activepin" title="Permanent link">¶</a></h2>
|
||||
<p>Check if a pin has an interrupt event associated.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> pin to check (D2-D8) if there's an associated interrupt event</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Bool}</code> - <code>True</code> if it has an interrupt event associated and <code>False</code> if otherwise.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiget_active_interrupts"><code>grovepi.get_active_interrupts()</code><a class="headerlink" href="#grovepiget_active_interrupts" title="Permanent link">¶</a></h2>
|
||||
<p>Get a list of all pins that have associated interrupt events.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: A list of integers representing the active pins that have interrupt events.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiread_interrupt_statepin"><code>grovepi.read_interrupt_state(pin)</code><a class="headerlink" href="#grovepiread_interrupt_statepin" title="Permanent link">¶</a></h2>
|
||||
<p>Get the recorded value by the interrupt event on the given pin.</p>
|
||||
<p>If an interrupt is set on pin D2 (D2 is taken as an example, it can be any other digital pin) with the type of operation set to <code>grovepi.COUNT_CHANGES</code> and mode of interrupt set to <code>grovepi.RISING</code> with a period set to <em>1000 ms</em>, then say if 567 rising edges are detected, then at the end of this period of <em>1000 ms</em>, this function will return for pin D2 value 567. And the returned value of this function on D2 pin will update every <em>1000 ms</em>, because that's the period that has been set for it. And the outcome varies depending on how the interrupt event is initially set.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> pin to check the recorded value for the associated interrupt event</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Bool}</code> - <code>True</code> if it has an interrupt event associated and <code>False</code> if otherwise.</p>
|
||||
<hr />
|
||||
<h2 id="grovepidust_sensor_enpin-2-period-30000"><code>grovepi.dust_sensor_en(pin = 2, period = 30000)</code><a class="headerlink" href="#grovepidust_sensor_enpin-2-period-30000" title="Permanent link">¶</a></h2>
|
||||
<p>Enables the <a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a>.</p>
|
||||
<p>If there is another interrupt event set on this pin, calling this method will overwrite the previous setting. Check <a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period">grovepi.set_pin_interrupt</a> to find out more. It's the same effect as with calling this after calling <a href="#grovepiencoder_enpin-2-steps-32">grovepi.encoder_en</a> or <a href="#grovepiflowenablepin-2-period-2000">grovepi.flowEnable</a>. </p>
|
||||
<p>This function is the same as calling <code>set_pin_interrupt(pin, ftype=COUNT_LOW_DURATION, interrupt_mode=CHANGE, period=period)</code>.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the dust sensor is assigned to</li>
|
||||
<li><code>period {Integer}</code> refresh time frame for the dust sensor. Maximum value for this parameter is <em>65535</em> ms.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepidust_sensor_dispin-2"><code>grovepi.dust_sensor_dis(pin = 2)</code><a class="headerlink" href="#grovepidust_sensor_dispin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Disables the <a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a>.</p>
|
||||
<p>To disable the dust sensor that sits on the given pin. It's the same as calling <a href="#grovepiunset_pin_interruptpin">unset_pin_interrupt</a> function. </p>
|
||||
<p><em>This function will be removed from future versions and it's only kept for making the API backwards-compatible.</em></p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the dust sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepidust_sensor_readpin-2-period-30000"><code>grovepi.dust_sensor_read(pin = 2, period = 30000)</code><a class="headerlink" href="#grovepidust_sensor_readpin-2-period-30000" title="Permanent link">¶</a></h2>
|
||||
<p>Reads the low pulse occupancy of the <a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a> in the given period of time as set with <a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period">grovepi.set_pin_interrupt</a> function.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> - the pin (D2-D8) to which the dust sensor is connected to</li>
|
||||
<li><code>period {Integer}</code> - refresh time frame for the dust sensor as set with <a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period">grovepi.set_pin_interrupt</a> function. Maximum value for this parameter is <em>65535</em> ms.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{(Integer, Float, Float)}</code> list</p>
|
||||
<ul>
|
||||
<li>1st element is the LPO time</li>
|
||||
<li>the 2nd one is the percentage (LPO time divided by total period)</li>
|
||||
<li>the 3rd is the concentration as measured in <em>pcs/283ml=0.01cf</em> where the particle size is over <em>1um</em></li>
|
||||
</ul>
|
||||
<p>The dust sensor's characteristics can be seen in the following graph.</p>
|
||||
<p><img alt="Grove Dust Sensor Characteristics" src="../../img/dust_sensor_characteristics.jpg" /></p>
|
||||
<hr />
|
||||
<h2 id="grovepiencoder_enpin-2-steps-32"><code>grovepi.encoder_en(pin = 2, steps = 32)</code><a class="headerlink" href="#grovepiencoder_enpin-2-steps-32" title="Permanent link">¶</a></h2>
|
||||
<p>Enable the <a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a>.</p>
|
||||
<p>If the pin already has an associated interrupt event, calling this method will overwrite the setting with the new change for the given pin.</p>
|
||||
<p>Since the encoder needs two interrupt-enabled pins, when calling this function for a <em>pin</em>, it also attaches the next pin in line <em>pin + 1</em>. To see which pins have been attached, call <a href="#grovepiget_active_interrupts">get_active_interrupts</a> function.</p>
|
||||
<p><strong>Parameters</strong>: </p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>pin {Integer}</code> the pin to which the encoder is connected to. It also attaches the pin right next up in its line <em>pin + 1</em>. Can be set for D2-D7 pins. Notice how the last one can't be used because there would have to be another pin available after it, but there isn't because it's the last one in the chain.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>steps {Integer}</code> specifies the number of steps for the encoder</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiencoder_dispin-2"><code>grovepi.encoder_dis(pin = 2)</code><a class="headerlink" href="#grovepiencoder_dispin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Disable the <a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a>.</p>
|
||||
<p>Necessary if you want to set output values to this pin with <a href="../gpio/#grovepidigitalwritepin-value">grovepi.digitalWrite</a> function. It's the same as calling <a href="#grovepiunset_pin_interruptpin">unset_pin_interrupt</a> function for <em>pin</em> and <em>pin + 1</em>. </p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the flow sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiencoderreadpin-2"><code>grovepi.encoderRead(pin = 2)</code><a class="headerlink" href="#grovepiencoderreadpin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Read the data off of the <a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a>.</p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> - the pin (D2-D7) to which the encoder is attached to.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Integer}</code> the current position of the encoder</p>
|
||||
<hr />
|
||||
<h2 id="grovepiflowenablepin-2-period-2000"><code>grovepi.flowEnable(pin = 2, period = 2000)</code><a class="headerlink" href="#grovepiflowenablepin-2-period-2000" title="Permanent link">¶</a></h2>
|
||||
<p>Enables the <a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a>.</p>
|
||||
<p>This function literally counts the number of rising pulses in the given time period. Because of that, calling this is the same as calling <code>set_pin_interrupt(pin, ftype=COUNT_CHANGES, interrupt_mode=RISING, period=period)</code> for <em>pin</em>.</p>
|
||||
<p>If the pin already has an associated interrupt event, calling this method will overwrite the setting with the new change for the given pin.</p>
|
||||
<p><em>This function will be removed from future versions and it's only kept for making the API backwards-compatible.</em></p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the dust sensor is assigned to</li>
|
||||
<li><code>period {Integer}</code> refresh time frame for the dust sensor. Maximum value for this parameter is <em>65535</em> ms.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiflowdisablepin-2"><code>grovepi.flowDisable(pin = 2)</code><a class="headerlink" href="#grovepiflowdisablepin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Disables the <a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a>.</p>
|
||||
<p>Necessary if you want to set output values to this pin with <a href="../gpio/#grovepidigitalwritepin-value">grovepi.digitalWrite</a> function. It's the same as calling <a href="#grovepiunset_pin_interruptpin">unset_pin_interrupt</a> function.</p>
|
||||
<p><em>This function will be removed from future versions and it's only kept for making the API backwards-compatible.</em></p>
|
||||
<p><strong>Parameters</strong>: </p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the flow sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiflowreadpin-2"><code>grovepi.flowRead(pin = 2)</code><a class="headerlink" href="#grovepiflowreadpin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Enables the <a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a>.</p>
|
||||
<p>This function counts the number of rising pulses in the time period set with <a href="#grovepiflowenablepin-2-period-2000">grovepi.flowEnable</a>.</p>
|
||||
<p>It's the same as calling <a href="#grovepiread_interrupt_statepin">grovepi.read_interrupt_state</a> for the given pin.</p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the flow sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Integer}</code> number of rising pulses that occurred within the given time frame</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../complex/" title="Complex Devices" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Complex Devices
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../../supported/" title="Supported Modules" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Supported Modules
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
4
docs/assets/fonts/font-awesome.css
vendored
Normal file
13
docs/assets/fonts/material-icons.css
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/*!
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy
|
||||
* of the License at:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
|
||||
* DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
* SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
|
||||
* LIMITATIONS UNDER THE LICENSE.
|
||||
*/@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")}
|
||||
BIN
docs/assets/fonts/specimen/FontAwesome.ttf
Normal file
BIN
docs/assets/fonts/specimen/FontAwesome.woff
Normal file
BIN
docs/assets/fonts/specimen/FontAwesome.woff2
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.ttf
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff
Normal file
BIN
docs/assets/fonts/specimen/MaterialIcons-Regular.woff2
Normal file
BIN
docs/assets/images/favicon.png
Normal file
|
After Width: | Height: | Size: 521 B |
20
docs/assets/images/icons/bitbucket.1b09e088.svg
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="352" height="448"
|
||||
viewBox="0 0 352 448" id="__bitbucket">
|
||||
<path fill="currentColor" d="M203.75 214.75q2 15.75-12.625 25.25t-27.875
|
||||
1.5q-9.75-4.25-13.375-14.5t-0.125-20.5 13-14.5q9-4.5 18.125-3t16 8.875
|
||||
6.875 16.875zM231.5 209.5q-3.5-26.75-28.25-41t-49.25-3.25q-15.75
|
||||
7-25.125 22.125t-8.625 32.375q1 22.75 19.375 38.75t41.375 14q22.75-2
|
||||
38-21t12.5-42zM291.25
|
||||
74q-5-6.75-14-11.125t-14.5-5.5-17.75-3.125q-72.75-11.75-141.5 0.5-10.75
|
||||
1.75-16.5 3t-13.75 5.5-12.5 10.75q7.5 7 19 11.375t18.375 5.5 21.875
|
||||
2.875q57 7.25 112 0.25 15.75-2 22.375-3t18.125-5.375 18.75-11.625zM305.5
|
||||
332.75q-2 6.5-3.875 19.125t-3.5 21-7.125 17.5-14.5 14.125q-21.5
|
||||
12-47.375 17.875t-50.5 5.5-50.375-4.625q-11.5-2-20.375-4.5t-19.125-6.75-18.25-10.875-13-15.375q-6.25-24-14.25-73l1.5-4
|
||||
4.5-2.25q55.75 37 126.625 37t126.875-37q5.25 1.5 6 5.75t-1.25 11.25-2
|
||||
9.25zM350.75 92.5q-6.5 41.75-27.75 163.75-1.25 7.5-6.75 14t-10.875
|
||||
10-13.625 7.75q-63 31.5-152.5
|
||||
22-62-6.75-98.5-34.75-3.75-3-6.375-6.625t-4.25-8.75-2.25-8.5-1.5-9.875-1.375-8.75q-2.25-12.5-6.625-37.5t-7-40.375-5.875-36.875-5.5-39.5q0.75-6.5
|
||||
4.375-12.125t7.875-9.375 11.25-7.5 11.5-5.625 12-4.625q31.25-11.5
|
||||
78.25-16 94.75-9.25 169 12.5 38.75 11.5 53.75 30.5 4 5 4.125
|
||||
12.75t-1.375 13.5z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
18
docs/assets/images/icons/github.f0b8504a.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
38
docs/assets/images/icons/gitlab.6dd19c00.svg
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"
|
||||
viewBox="0 0 500 500" id="__gitlab">
|
||||
<g transform="translate(156.197863, 1.160267)">
|
||||
<path fill="currentColor"
|
||||
d="M93.667,473.347L93.667,473.347l90.684-279.097H2.983L93.667,
|
||||
473.347L93.667,473.347z" />
|
||||
</g>
|
||||
<g transform="translate(28.531199, 1.160800)" opacity="0.7">
|
||||
<path fill="currentColor"
|
||||
d="M221.333,473.345L130.649,194.25H3.557L221.333,473.345L221.333,
|
||||
473.345z" />
|
||||
</g>
|
||||
<g transform="translate(0.088533, 0.255867)" opacity="0.5">
|
||||
<path fill="currentColor"
|
||||
d="M32,195.155L32,195.155L4.441,279.97c-2.513,7.735,0.24,16.21,6.821,
|
||||
20.99l238.514,173.29 L32,195.155L32,195.155z" />
|
||||
</g>
|
||||
<g transform="translate(29.421866, 280.255593)">
|
||||
<path fill="currentColor"
|
||||
d="M2.667-84.844h127.092L75.14-252.942c-2.811-8.649-15.047-8.649-17.856,
|
||||
0L2.667-84.844 L2.667-84.844z" />
|
||||
</g>
|
||||
<g transform="translate(247.197860, 1.160800)" opacity="0.7">
|
||||
<path fill="currentColor"
|
||||
d="M2.667,473.345L93.351,194.25h127.092L2.667,473.345L2.667,
|
||||
473.345z" />
|
||||
</g>
|
||||
<g transform="translate(246.307061, 0.255867)" opacity="0.5">
|
||||
<path fill="currentColor"
|
||||
d="M221.334,195.155L221.334,195.155l27.559,84.815c2.514,7.735-0.24,
|
||||
16.21-6.821,20.99 L3.557,474.25L221.334,195.155L221.334,195.155z" />
|
||||
</g>
|
||||
<g transform="translate(336.973725, 280.255593)">
|
||||
<path fill="currentColor"
|
||||
d="M130.667-84.844H3.575l54.618-168.098c2.811-8.649,15.047-8.649,
|
||||
17.856,0L130.667-84.844 L130.667-84.844z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
6
docs/assets/javascripts/application.267712eb.js
Normal file
1
docs/assets/javascripts/application.a59e2a89.js
Normal file
6
docs/assets/javascripts/application.b806dc00.js
Normal file
1
docs/assets/javascripts/lunr/lunr.da.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,m,i;e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=(r=e.stemmerSupport.Among,m=e.stemmerSupport.SnowballProgram,i=new function(){var i,t,n,s=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],o=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],u=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],c=new m;function l(){var e,r=c.limit-c.cursor;c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.find_among_b(o,4)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e)}this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r=c.cursor;return function(){var e,r=c.cursor+3;if(t=c.limit,0<=r&&r<=c.limit){for(i=r;;){if(e=c.cursor,c.in_grouping(d,97,248)){c.cursor=e;break}if((c.cursor=e)>=c.limit)return;c.cursor++}for(;!c.out_grouping(d,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(t=c.cursor)<i&&(t=i)}}(),c.limit_backward=r,c.cursor=c.limit,function(){var e,r;if(c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,e=c.find_among_b(s,32),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(u,97,229)&&c.slice_del()}}(),c.cursor=c.limit,l(),c.cursor=c.limit,function(){var e,r,i,n=c.limit-c.cursor;if(c.ket=c.cursor,c.eq_s_b(2,"st")&&(c.bra=c.cursor,c.eq_s_b(2,"ig")&&c.slice_del()),c.cursor=c.limit-n,c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,e=c.find_among_b(a,5),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del(),i=c.limit-c.cursor,l(),c.cursor=c.limit-i;break;case 2:c.slice_from("løs")}}(),c.cursor=c.limit,c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.out_grouping_b(d,97,248)?(c.bra=c.cursor,n=c.slice_to(n),c.limit_backward=e,c.eq_v_b(n)&&c.slice_del()):c.limit_backward=e),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
|
||||
1
docs/assets/javascripts/lunr/lunr.de.js
Normal file
1
docs/assets/javascripts/lunr/lunr.du.js
Normal file
1
docs/assets/javascripts/lunr/lunr.es.js
Normal file
1
docs/assets/javascripts/lunr/lunr.fi.js
Normal file
1
docs/assets/javascripts/lunr/lunr.fr.js
Normal file
1
docs/assets/javascripts/lunr/lunr.hu.js
Normal file
1
docs/assets/javascripts/lunr/lunr.it.js
Normal file
1
docs/assets/javascripts/lunr/lunr.ja.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(m){if(void 0===m)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===m.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var l="2"==m.version[0];m.ja=function(){this.pipeline.reset(),this.pipeline.add(m.ja.trimmer,m.ja.stopWordFilter,m.ja.stemmer),l?this.tokenizer=m.ja.tokenizer:(m.tokenizer&&(m.tokenizer=m.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=m.ja.tokenizer))};var j=new m.TinySegmenter;m.ja.tokenizer=function(e){var r,t,i,n,o,s,p,a,u;if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return l?new m.Token(e.toLowerCase()):e.toLowerCase()});for(r=(t=e.toString().toLowerCase().replace(/^\s+/,"")).length-1;0<=r;r--)if(/\S/.test(t.charAt(r))){t=t.substring(0,r+1);break}for(o=[],i=t.length,p=a=0;a<=i;a++)if(s=a-p,t.charAt(a).match(/\s/)||a==i){if(0<s)for(n=j.segment(t.slice(p,a)).filter(function(e){return!!e}),u=p,r=0;r<n.length;r++)l?o.push(new m.Token(n[r],{position:[u,n[r].length],index:o.length})):o.push(n[r]),u+=n[r].length;p=a+1}return o},m.ja.stemmer=function(e){return e},m.Pipeline.registerFunction(m.ja.stemmer,"stemmer-ja"),m.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",m.ja.trimmer=m.trimmerSupport.generateTrimmer(m.ja.wordCharacters),m.Pipeline.registerFunction(m.ja.trimmer,"trimmer-ja"),m.ja.stopWordFilter=m.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),m.Pipeline.registerFunction(m.ja.stopWordFilter,"stopWordFilter-ja"),m.jp=m.ja,m.Pipeline.registerFunction(m.jp.stemmer,"stemmer-jp"),m.Pipeline.registerFunction(m.jp.trimmer,"trimmer-jp"),m.Pipeline.registerFunction(m.jp.stopWordFilter,"stopWordFilter-jp")}});
|
||||
1
docs/assets/javascripts/lunr/lunr.jp.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
module.exports=require("./lunr.ja");
|
||||
1
docs/assets/javascripts/lunr/lunr.multi.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(o){o.multiLanguage=function(){for(var e=Array.prototype.slice.call(arguments),i=e.join("-"),t="",r=[],n=[],s=0;s<e.length;++s)"en"==e[s]?(t+="\\w",r.unshift(o.stopWordFilter),r.push(o.stemmer),n.push(o.stemmer)):(t+=o[e[s]].wordCharacters,r.unshift(o[e[s]].stopWordFilter),r.push(o[e[s]].stemmer),n.push(o[e[s]].stemmer));var p=o.trimmerSupport.generateTrimmer(t);return o.Pipeline.registerFunction(p,"lunr-multi-trimmer-"+i),r.unshift(p),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,r),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,n))}}}});
|
||||
1
docs/assets/javascripts/lunr/lunr.nl.js
Normal file
1
docs/assets/javascripts/lunr/lunr.no.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,n,i;e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=(r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){var o,s,a=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],m=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],d=[119,125,149,1],c=new n;this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r,n,i,t=c.cursor;return function(){var e,r=c.cursor+3;if(s=c.limit,0<=r||r<=c.limit){for(o=r;;){if(e=c.cursor,c.in_grouping(u,97,248)){c.cursor=e;break}if(e>=c.limit)return;c.cursor=e+1}for(;!c.out_grouping(u,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(s=c.cursor)<o&&(s=o)}}(),c.limit_backward=t,c.cursor=c.limit,function(){var e,r,n;if(c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,e=c.find_among_b(a,29),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:n=c.limit-c.cursor,c.in_grouping_b(d,98,122)?c.slice_del():(c.cursor=c.limit-n,c.eq_s_b(1,"k")&&c.out_grouping_b(u,97,248)&&c.slice_del());break;case 3:c.slice_from("er")}}(),c.cursor=c.limit,r=c.limit-c.cursor,c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.find_among_b(m,2)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e),c.cursor=c.limit,c.cursor>=s&&(i=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,(n=c.find_among_b(l,11))?(c.bra=c.cursor,c.limit_backward=i,1==n&&c.slice_del()):c.limit_backward=i),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
|
||||
1
docs/assets/javascripts/lunr/lunr.pt.js
Normal file
1
docs/assets/javascripts/lunr/lunr.ro.js
Normal file
1
docs/assets/javascripts/lunr/lunr.ru.js
Normal file
1
docs/assets/javascripts/lunr/lunr.stemmer.support.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var b;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(r){b=r,this.cursor=0,this.limit=r.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var r=b;return b=null,r},in_grouping:function(r,t,i){if(this.cursor<this.limit){var s=b.charCodeAt(this.cursor);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor++,!0}return!1},in_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor--,!0}return!1},out_grouping:function(r,t,i){if(this.cursor<this.limit){var s=b.charCodeAt(this.cursor);if(i<s||s<t)return this.cursor++,!0;if(!(r[(s-=t)>>3]&1<<(7&s)))return this.cursor++,!0}return!1},out_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(i<s||s<t)return this.cursor--,!0;if(!(r[(s-=t)>>3]&1<<(7&s)))return this.cursor--,!0}return!1},eq_s:function(r,t){if(this.limit-this.cursor<r)return!1;for(var i=0;i<r;i++)if(b.charCodeAt(this.cursor+i)!=t.charCodeAt(i))return!1;return this.cursor+=r,!0},eq_s_b:function(r,t){if(this.cursor-this.limit_backward<r)return!1;for(var i=0;i<r;i++)if(b.charCodeAt(this.cursor-r+i)!=t.charCodeAt(i))return!1;return this.cursor-=r,!0},find_among:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u<o?u:o,l=r[c],_=f;_<l.s_size;_++){if(e+f==n){a=-1;break}if(a=b.charCodeAt(e+f)-l.s[_])break;f++}if(a<0?(s=c,o=f):(i=c,u=f),s-i<=1){if(0<i||s==i||h)break;h=!0}}for(;;){if(u>=(l=r[i]).s_size){if(this.cursor=e+l.s_size,!l.method)return l.result;var m=l.method();if(this.cursor=e+l.s_size,m)return l.result}if((i=l.substring_i)<0)return 0}},find_among_b:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit_backward,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u<o?u:o,l=(_=r[c]).s_size-1-f;0<=l;l--){if(e-f==n){a=-1;break}if(a=b.charCodeAt(e-1-f)-_.s[l])break;f++}if(a<0?(s=c,o=f):(i=c,u=f),s-i<=1){if(0<i||s==i||h)break;h=!0}}for(;;){var _;if(u>=(_=r[i]).s_size){if(this.cursor=e-_.s_size,!_.method)return _.result;var m=_.method();if(this.cursor=e-_.s_size,m)return _.result}if((i=_.substring_i)<0)return 0}},replace_s:function(r,t,i){var s=i.length-(t-r);return b=b.substring(0,r)+i+b.substring(t),this.limit+=s,this.cursor>=t?this.cursor+=s:this.cursor>r&&(this.cursor=r),s},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>b.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),b.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
|
||||
1
docs/assets/javascripts/lunr/lunr.sv.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,l,n;e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=(r=e.stemmerSupport.Among,l=e.stemmerSupport.SnowballProgram,n=new function(){var n,t,i=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],s=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],o=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],u=[119,127,149],m=new l;this.setCurrent=function(e){m.setCurrent(e)},this.getCurrent=function(){return m.getCurrent()},this.stem=function(){var e,r=m.cursor;return function(){var e,r=m.cursor+3;if(t=m.limit,0<=r||r<=m.limit){for(n=r;;){if(e=m.cursor,m.in_grouping(o,97,246)){m.cursor=e;break}if(m.cursor=e,m.cursor>=m.limit)return;m.cursor++}for(;!m.out_grouping(o,97,246);){if(m.cursor>=m.limit)return;m.cursor++}(t=m.cursor)<n&&(t=n)}}(),m.limit_backward=r,m.cursor=m.limit,function(){var e,r=m.limit_backward;if(m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(i,37),m.limit_backward=r,e))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.in_grouping_b(u,98,121)&&m.slice_del()}}(),m.cursor=m.limit,e=m.limit_backward,m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.find_among_b(s,7)&&(m.cursor=m.limit,m.ket=m.cursor,m.cursor>m.limit_backward&&(m.bra=--m.cursor,m.slice_del())),m.limit_backward=e),m.cursor=m.limit,function(){var e,r;if(m.cursor>=t){if(r=m.limit_backward,m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(a,5))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.slice_from("lös");break;case 3:m.slice_from("full")}m.limit_backward=r}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
|
||||
1
docs/assets/javascripts/lunr/lunr.th.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(t){if(void 0===t)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===t.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==t.version[0];t.th=function(){this.pipeline.reset(),this.pipeline.add(t.th.trimmer),i?this.tokenizer=t.th.tokenizer:(t.tokenizer&&(t.tokenizer=t.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=t.th.tokenizer))},t.th.wordCharacters="[-]",t.th.trimmer=t.trimmerSupport.generateTrimmer(t.th.wordCharacters),t.Pipeline.registerFunction(t.th.trimmer,"trimmer-th");var n=t.wordcut;n.init(),t.th.tokenizer=function(e){if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return i?new t.Token(e):e});var r=e.toString().replace(/^\s+/,"");return n.cut(r).split("|")}}});
|
||||
1
docs/assets/javascripts/lunr/lunr.tr.js
Normal file
1
docs/assets/javascripts/lunr/tinyseg.js
Normal file
1
docs/assets/javascripts/lunr/wordcut.js
Normal file
1
docs/assets/javascripts/modernizr.01ccdecf.js
Normal file
1
docs/assets/javascripts/modernizr.1aa3b519.js
Normal file
1
docs/assets/javascripts/modernizr.1f0bcf2b.js
Normal file
1
docs/assets/stylesheets/application-palette.224b79ff.css
Normal file
2
docs/assets/stylesheets/application-palette.6079476c.css
Normal file
1
docs/assets/stylesheets/application.3020aac5.css
Normal file
1
docs/assets/stylesheets/application.982221ab.css
Normal file
2
docs/assets/stylesheets/application.ba0fd1a6.css
Normal file
7
docs/dev/Dockerfile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
FROM python:alpine3.7
|
||||
|
||||
RUN pip install mkdocs mkdocs-material
|
||||
|
||||
WORKDIR /docs
|
||||
|
||||
CMD ["mkdocs", "serve", "--livereload", "-a", "0.0.0.0:8000"]
|
||||
477
docs/dev/index.html
Normal file
|
|
@ -0,0 +1,477 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/dev/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#development-notes" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Development Notes
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href=".." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/dev/README.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="development-notes">Development Notes<a class="headerlink" href="#development-notes" title="Permanent link">¶</a></h1>
|
||||
<p>To fire up a development environment for the documentation, you need to build this docker file first</p>
|
||||
<div class="codehilite"><pre><span></span>docker image build -t dexterind/grovepi-docs .
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>Once you have that, you need to fire up the container. First make sure you are running this from the root of this repository and then run</p>
|
||||
<div class="codehilite"><pre><span></span>docker container run -v $(pwd)/docs:/docs -it --rm -p 80:8000 dexterind/grovepi-docs
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>To have the documentation built run from the root of this repository</p>
|
||||
<div class="codehilite"><pre><span></span>docker container run -v $(pwd)/docs:/docs -it --rm dexterind/grovepi-docs mkdocs build -c
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>and wait for it to exit the process and then copy the contents of the newly created directory <code>site</code> and place it into the <code>/docs</code> directory.</p>
|
||||
<p>Enjoy developing and when you're done with it, build the documentation and save the statics in the docs folder.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
294
docs/docs/api/complex.md
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
#API - Complex Devices
|
||||
|
||||
In this section the Python API reference for more complex devices is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.
|
||||
|
||||
The API for the following sensors is described in this section:
|
||||
|
||||
- [Grove LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/)
|
||||
- [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/)
|
||||
- [Grove Chainable RGB LED](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html)
|
||||
|
||||
---
|
||||
**IMPORTANT**
|
||||
|
||||
This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.
|
||||
|
||||
In case you need to reset the GrovePi from your Raspberry Pi, [check this section](../fw/#resetting-the-grovepi).
|
||||
|
||||
The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.
|
||||
---
|
||||
|
||||
##`grovepi.ledBar_init(pin, orientation)`
|
||||
Initialize an [LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which the LED bar is assigned to
|
||||
- `orientation {Integer}` `0` to go from red to green or 1 to go the other way
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ledBar_orientation(pin, orientation)`
|
||||
Set the orientation on an already initialized [LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which the LED bar is assigned to
|
||||
- `orientation {Integer}` `0` to go from red to green or 1 to go the other way
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ledBar_setLevel(pin, level)`
|
||||
Set the level on an [LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which the LED bar is assigned to
|
||||
- `orientation {Integer}` `0` to `10` corresponding to the number of levels that exist on the LED bar.
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ledBar_toggleLed(pin, led)`
|
||||
Toggle the state of one LED of the 10 levels of the [LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which the LED bar is assigned to
|
||||
- `led {Integer}` taking values from `0` to `10` depending on which LED to toggle
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ledBar_setBits(pin, state)`
|
||||
Set the LED activations of the [LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/) based on the binary representation of a 10-bit number.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which the LED bar is assigned to
|
||||
- `state {Integer}` a number from `0` to `1023` that covers all states for all 10 LEDs of the LED bar
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ledBar_getBits(pin)`
|
||||
Read the state of LED activations on the [LED bar](http://wiki.seeedstudio.com/Grove-LED_Bar/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which the LED bar is assigned to
|
||||
|
||||
**Returns**: a number from `0` to `1023` to represent the binary state of all 10 LEDs of the LED bar
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_init(pin)`
|
||||
Initialize a [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_number(pin, value, leading_zero)`
|
||||
Set the [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/) to display a number.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
- `value {Integer}` a value between `0` and `9999` representing the number to be printed on the display
|
||||
- `leading_zero {Boolean}` whether to add leading zeros or not
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_brightness(pin, brightness)`
|
||||
Set the brightness of the [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
- `brightness {Integer}` a number between `0` (for the darkest option) and `7` (for the brightest) representing the brightness of the display
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_digit(pin, segment, value)`
|
||||
Set individual segment of the [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
- `segment {Integer}` a number from `0` to `3` representing the segment
|
||||
- `value {Integer}` value of the segment - `0` to `15`
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_segment(pin, segment, leds)`
|
||||
Set the individual LED segments of a digit of the [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
- `segment {Integer}` which segment of the display to modify (`0` to `3`)
|
||||
- `leds {Integer}` a number from `0` to `255` representing the binary activations of the selected `segment` - the 8th bit is the colon
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_score(pin, left, right)`
|
||||
Set values on either side of the [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/).
|
||||
To the left and right values, leading zeros are added and the colon is lit up
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
- `left {Integer}` value to be displayed on the left side of the display (takes values from `0` to `99`)
|
||||
- `right {Integer}` value to be displayed on the right side of the display (takes values from `0` to `99`)
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_monitor(pin, analog, duration)`
|
||||
Display the [analogRead](#grovepianalogreadpin) values onto the [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/) for a given time.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
- `analog {Integer}` the port (A0-A2) on which analog values are read from
|
||||
- `duration {Integer}` for how many seconds (`0` to `255`) the readings are to be displayed
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_on(pin)`
|
||||
Turn the whole [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/) on.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.fourDigit_off(pin)`
|
||||
Turn the whole [Grove 4-Digit Display](http://wiki.seeedstudio.com/Grove-4-Digit_Display/) off.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the 4-Digit display is set to
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.storeColor(red, green, blue)`
|
||||
Store a color for later use with the [Grove Chainable RGB LED](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `red {Integer}` value from `0` to `255`
|
||||
- `green {Integer}` value from `0` to `255`
|
||||
- `blue {Integer}` value from `0` to `255`
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.chainableRgbLed_init(pin, numLeds)`
|
||||
Initialize a number of [chained LEDs](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html) on given port.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the Grove RGB LED(s) are connected to
|
||||
- `numLeds {Integer}` number of chained LEDs
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.chainableRgbLed_test(pin, numLeds, testColor)`
|
||||
Initialize [chained LEDs](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html) on given port and set a test color on all of them.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the Grove RGB LED(s) are connected to
|
||||
- `numLeds {Integer}` number of chained LEDs
|
||||
- `testColor {Integer}` the color to use for all chained LEDs
|
||||
|
||||
- `0` for black (or nothing)
|
||||
- `1` for blue
|
||||
- `2` for green
|
||||
- `3` for cyan
|
||||
- `4` for red
|
||||
- `5` for magenta
|
||||
- `6` for yellow
|
||||
- `7` for white
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.chainableRgbLed_pattern(pin, pattern, whichLed)`
|
||||
Set one or more [chained LEDs](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html) to a stored color following a given pattern.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the Grove RGB LED(s) are connected to
|
||||
- `pattern {Integer}`
|
||||
|
||||
- `0` for this LED only
|
||||
- `1` for all LEDs except this LED
|
||||
- `2` this LED and all LEDs inwards
|
||||
- `3` this LED and all LEDs outwards
|
||||
|
||||
- `whichLed {Integer}` the index of the LED you wish to set counting outwards from the GrovePi starting with `0`
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.chainableRgbLed_modulo(pin, offset, divisor)`
|
||||
Set one or more [chained LEDs](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html) to a stored color following the "pattern" of the modulo operation.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the Grove RGB LED(s) are connected to
|
||||
- `offset {Integer}` the index of the LED you want to start at (`0` is for the 1st LED)
|
||||
- `divisor {Integer}` sets the color to those LEDs of whose indexes divided by `divisor` have the remainder set to `0` - for `divisor=1` every LED gets set, but for `divisor=2` every 2nd LED gets set
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.chainableRgbLed_setLevel(pin, level, reverse)`
|
||||
Set one or more [chained LEDs](https://www.seeedstudio.com/Grove-Chainable-RGB-LED-p-850.html) to a stored color similar to a bar graph.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the port (D2-D8) to which the Grove RGB LED(s) are connected to
|
||||
- `level {Integer}` the number of LEDs you want to set to the stored color
|
||||
- `reverse {Integer}` `0` when counting outwards from the GrovePi or `1` when it's the other way (from the most outward LED inwards)
|
||||
|
||||
**Returns**: `1` all the time
|
||||
111
docs/docs/api/general.md
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
#API - General Sensors
|
||||
|
||||
In this section the Python API reference for diverse sensors is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.
|
||||
|
||||
In this section, the API for the following sensors is described:
|
||||
|
||||
- [Grove Temperature Sensor](http://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/)
|
||||
- [Grove Ultrasonic Sensor](https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html)
|
||||
- [DHT11](http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/)
|
||||
- [DHT22](http://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/)
|
||||
- [Grove IR Receiver](https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html) necessary for the [Infrared Remote](https://www.dexterindustries.com/shop/infrared-remote/)
|
||||
|
||||
---
|
||||
**IMPORTANT**
|
||||
|
||||
This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.
|
||||
|
||||
In case you need to reset the GrovePi from your Raspberry Pi, [check this section](../fw/#resetting-the-grovepi).
|
||||
|
||||
The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.
|
||||
---
|
||||
|
||||
##`grovepi.temp(pin, model='1.0')`
|
||||
Read temperature from the [Grove Temperature Sensor](http://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/) on the GrovePi.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (A0-A2) from which to do the reading
|
||||
- `model {String}` `"1.0"`, `"1.1"`, `"1.2"` depending on the used model
|
||||
|
||||
**Returns**: `{Float}` number to represent the temperature in ºC
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ultrasonicRead(pin)`
|
||||
Read the distance to an object with the [Grove Ultrasonic Sensor](https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html) on the GrovePi.
|
||||
The closer it is to the targeted object, the faster the sample rate and slower when it's farther.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) from which to do the reading
|
||||
|
||||
**Returns**: `{Integer}` number to represent the distance to the object in centimeters
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.version()`
|
||||
Read the version of the firmware.
|
||||
|
||||
**Returns**: a `{String}` representing the firmware version (i.e. `"1.2.7"`)
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.dht(pin, module_type)`
|
||||
Read the temperature and humidity on the GrovePi with one of the given modules.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) from which to do the reading
|
||||
- `module_type {Integer}` a number to identify the model
|
||||
|
||||
- `0` for [DHT11](http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/)
|
||||
- `1` for [DHT22](http://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/)
|
||||
- `2` for DHT21
|
||||
- `3` for AM2301
|
||||
|
||||
**Returns**: a `{(Float, Float}` list where the 1st parameter is the temperature in ºC and the 2nd one is the humidity as a percentage.
|
||||
|
||||
**On Error**: it returns a `{(Float, Float)}` list containing `NaN`s. This happens when the sensor can't keep up with the demanded sample rate.
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ir_read_signal()`
|
||||
Get the decoded value from the [Grove IR Receiver](https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html). For this you need to use a remote control of any kind. The preferred one we use is the [Infrared Remote](https://www.dexterindustries.com/shop/infrared-remote/).
|
||||
|
||||
In order to use this function, you first need to call [grovepi.ir_recv_pin](#grovepiir_recv_pinpin) function to bind the functionality to a given port.
|
||||
|
||||
**Parameters**: None
|
||||
|
||||
**Returns**: a 3-element list of this form `{(Integer, Integer, Integer)}`
|
||||
|
||||
- The 1st element keeps an `{Integer}` corresponding to a certain brand:
|
||||
|
||||
- `-1` for unknown and `0` for unused
|
||||
- RC2, RC5, NEC, SONY, PANASONIC, JVC, SAMSUNG, WHYNTER, AIWA_RC_T501, LG, SANYO, MITSUBISHI, DISH, SHARP, DENON, PRONTO, LEGO_PF having values from `1` to `17`
|
||||
|
||||
- The 2nd element is a 16-bit address used by some Panasonic and Sharp remotes
|
||||
- The 3rd element is the 32-bit decoded value that can be used to identify which buttons were pressed - since there's no map for them you need to do it on a case-by-case basis
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ir_recv_pin(pin)`
|
||||
Enable the [Grove IR Receiver](https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html) on a given port. Used in conjunction with [grovepi.ir_read_signal](#grovepiir_read_signal) and [grovepi.ir_is_data](#grovepiir_is_data).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` The port (D2-D8) to which the IR receiver gets connected to
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.ir_is_data()`
|
||||
Checks if there's available data coming from the [Grove IR Receiver](https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html). Used in conjunction with [grovepi.ir_read_signal](#grovepiir_read_signal) function.
|
||||
|
||||
**Parameters**: None
|
||||
|
||||
**Returns**: `True` or `False`
|
||||
72
docs/docs/api/gpio.md
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#API - GPIO Functions
|
||||
|
||||
In this section the Python API reference for GPIO functions is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.
|
||||
|
||||
---
|
||||
**IMPORTANT**
|
||||
|
||||
This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.
|
||||
|
||||
In case you need to reset the GrovePi from your Raspberry Pi, [check this section](../fw/#resetting-the-grovepi).
|
||||
|
||||
The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.
|
||||
---
|
||||
|
||||
##`grovepi.digitalRead(pin)`
|
||||
Reads whether a port's input is set high or low on the GrovePi.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) from which to do the reading
|
||||
|
||||
**Returns**: `0` or `1` depending on the input value
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.digitalWrite(pin, value)`
|
||||
Sets the output value to either `0` or `1` to a digital port on the GrovePi.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which to do the writing
|
||||
- `value {Integer}` either `0` for 0 volts or `1` for maximum output voltage (usually 5 volts)
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.analogRead(pin)`
|
||||
Detect an input voltage as a value from a given port on the GrovePi.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (A0-A2) from which to do the reading
|
||||
|
||||
**Returns**: a 10-bit `{Integer}` number that maps to the input voltage on the port
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.analogWrite(pin, value)`
|
||||
Set an output voltage on a PWM-enabled port by mapping the value to the desired voltage on the GrovePi.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (ports 3, 5, 6, 9) to which to do the writing
|
||||
- `value {Integer}` an 8-bit number that maps from 0V to the referenced voltage of the GrovePi (5V)
|
||||
|
||||
**Returns**: `1` all the time
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.pinMode(pin, mode)`
|
||||
Sets a port to be either an OUTPUT or an INPUT port on the GrovePi.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` a number to identify the port (D2-D8) to which to do the change
|
||||
- `mode {String}` `"OUTPUT"` for writing values or `"INPUT"` for reading
|
||||
|
||||
**Returns**: `1` all the time
|
||||
237
docs/docs/api/interrupt.md
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
#API - Interrupt-Based Devices
|
||||
|
||||
In this section the Python API reference for interrupt-based devices is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.
|
||||
|
||||
The API for the following sensors is described in this section:
|
||||
|
||||
- [Grove Dust Sensor](https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html)
|
||||
- [Grove Encoder](https://www.seeedstudio.com/Grove-Encoder-p-1352.html)
|
||||
- [Grove Water Flow Sensor](https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html) of whose functionality can be used in other applications too
|
||||
|
||||
Apart from describing the API for the above sensors, there is also described a set of functions used to set interrupt events on the GrovePi. These functions are like the building blocks of the API of the above sensors and can be used for your own implementation, should it be applicable to your device.
|
||||
|
||||
---
|
||||
**IMPORTANT**
|
||||
|
||||
This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.
|
||||
|
||||
In case you need to reset the GrovePi from your Raspberry Pi, [check this section](../../fw/#resetting-the-grovepi).
|
||||
|
||||
The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.
|
||||
---
|
||||
|
||||
##`grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)`
|
||||
Attach an interrupt event to a port.
|
||||
|
||||
Can be used to count pulses, duration of pulses, set different kinds of trigger modes (on change, rising or falling edges) all done within a given time period.
|
||||
|
||||
If there are subsequent calls to this set function without detaching the interrupt event first from a given pin, then it will overwrite the old setting and update it to reflect the latest one.
|
||||
|
||||
Also, setting this up disables the OUTPUT functionality on the selected pin. If the selected pin has to drive the output, then detach the interrupt event with [grovepi.unset_pin_interrupt](#grovepiunset_pin_interruptpin).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` can be pins D2-D8 to which the device is connected to
|
||||
- `ftype {Integer}` the type of event/operation associated for the given pin. Can take values `grovepi.COUNT_CHANGES` (for counting the number of triggers) or `grovepi.COUNT_LOW_DURATION` (which measures how much time the signal stays low in a given period).
|
||||
- `interrupt_mode {Integer}` triggering mode of the interrupt. It can be `grovepi.CHANGE`, `grovepi.FALLING` or `grovepi.RISING`, just like on the Arduino.
|
||||
- `period {Integer}` specifying after how long the recorded value should be stored on the GrovePi to be subsequently read on the master device (Raspberry Pi). Measured in milliseconds. Minimum value shouldn't be too small (say under *5 ms*) and the maximum value is *65535 ms*.
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.unset_pin_interrupt(pin)`
|
||||
Detach an interrupt event from a given pin.
|
||||
|
||||
Necessary if you want to set output values to this pin with [grovepi.digitalWrite](../gpio/#grovepidigitalwritepin-value) function.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` pins D2-D8 from which the interrupt is released from
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.unset_all_interrupts()`
|
||||
Detach all active interrupt events on all pins.
|
||||
|
||||
**Parameters**: None
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.is_interrupt_active(pin)`
|
||||
Check if a pin has an interrupt event associated.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` pin to check (D2-D8) if there's an associated interrupt event
|
||||
|
||||
**Returns**: `{Bool}` - `True` if it has an interrupt event associated and `False` if otherwise.
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.get_active_interrupts()`
|
||||
Get a list of all pins that have associated interrupt events.
|
||||
|
||||
**Parameters**: None
|
||||
|
||||
**Returns**: A list of integers representing the active pins that have interrupt events.
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.read_interrupt_state(pin)`
|
||||
Get the recorded value by the interrupt event on the given pin.
|
||||
|
||||
If an interrupt is set on pin D2 (D2 is taken as an example, it can be any other digital pin) with the type of operation set to `grovepi.COUNT_CHANGES` and mode of interrupt set to `grovepi.RISING` with a period set to *1000 ms*, then say if 567 rising edges are detected, then at the end of this period of *1000 ms*, this function will return for pin D2 value 567. And the returned value of this function on D2 pin will update every *1000 ms*, because that's the period that has been set for it. And the outcome varies depending on how the interrupt event is initially set.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` pin to check the recorded value for the associated interrupt event
|
||||
|
||||
**Returns**: `{Bool}` - `True` if it has an interrupt event associated and `False` if otherwise.
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.dust_sensor_en(pin = 2, period = 30000)`
|
||||
Enables the [Grove Dust Sensor](https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html).
|
||||
|
||||
If there is another interrupt event set on this pin, calling this method will overwrite the previous setting. Check [grovepi.set_pin_interrupt](#grovepiset_pin_interruptpin-ftype-interrupt_mode-period) to find out more. It's the same effect as with calling this after calling [grovepi.encoder_en](#grovepiencoder_enpin-2-steps-32) or [grovepi.flowEnable](#grovepiflowenablepin-2-period-2000).
|
||||
|
||||
This function is the same as calling `set_pin_interrupt(pin, ftype=COUNT_LOW_DURATION, interrupt_mode=CHANGE, period=period)`.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the pin (D2-D8) to which the dust sensor is assigned to
|
||||
- `period {Integer}` refresh time frame for the dust sensor. Maximum value for this parameter is *65535* ms.
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.dust_sensor_dis(pin = 2)`
|
||||
Disables the [Grove Dust Sensor](https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html).
|
||||
|
||||
To disable the dust sensor that sits on the given pin. It's the same as calling [unset_pin_interrupt](#grovepiunset_pin_interruptpin) function.
|
||||
|
||||
*This function will be removed from future versions and it's only kept for making the API backwards-compatible.*
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `pin {Integer}` the pin (D2-D8) to which the dust sensor is connected to
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.dust_sensor_read(pin = 2, period = 30000)`
|
||||
Reads the low pulse occupancy of the [Grove Dust Sensor](https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html) in the given period of time as set with [grovepi.set_pin_interrupt](#grovepiset_pin_interruptpin-ftype-interrupt_mode-period) function.
|
||||
|
||||
**Parameters**: None
|
||||
|
||||
- `pin {Integer}` - the pin (D2-D8) to which the dust sensor is connected to
|
||||
- `period {Integer}` - refresh time frame for the dust sensor as set with [grovepi.set_pin_interrupt](#grovepiset_pin_interruptpin-ftype-interrupt_mode-period) function. Maximum value for this parameter is *65535* ms.
|
||||
|
||||
**Returns**: `{(Integer, Float, Float)}` list
|
||||
|
||||
- 1st element is the LPO time
|
||||
- the 2nd one is the percentage (LPO time divided by total period)
|
||||
- the 3rd is the concentration as measured in _pcs/283ml=0.01cf_ where the particle size is over _1um_
|
||||
|
||||
The dust sensor's characteristics can be seen in the following graph.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
##`grovepi.encoder_en(pin = 2, steps = 32)`
|
||||
Enable the [Grove Encoder](https://www.seeedstudio.com/Grove-Encoder-p-1352.html).
|
||||
|
||||
If the pin already has an associated interrupt event, calling this method will overwrite the setting with the new change for the given pin.
|
||||
|
||||
Since the encoder needs two interrupt-enabled pins, when calling this function for a *pin*, it also attaches the next pin in line *pin + 1*. To see which pins have been attached, call [get_active_interrupts](#grovepiget_active_interrupts) function.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `pin {Integer}` the pin to which the encoder is connected to. It also attaches the pin right next up in its line *pin + 1*. Can be set for D2-D7 pins. Notice how the last one can't be used because there would have to be another pin available after it, but there isn't because it's the last one in the chain.
|
||||
|
||||
- `steps {Integer}` specifies the number of steps for the encoder
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.encoder_dis(pin = 2)`
|
||||
Disable the [Grove Encoder](https://www.seeedstudio.com/Grove-Encoder-p-1352.html).
|
||||
|
||||
Necessary if you want to set output values to this pin with [grovepi.digitalWrite](../gpio/#grovepidigitalwritepin-value) function. It's the same as calling [unset_pin_interrupt](#grovepiunset_pin_interruptpin) function for *pin* and *pin + 1*.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `pin {Integer}` the pin (D2-D8) to which the flow sensor is connected to
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.encoderRead(pin = 2)`
|
||||
Read the data off of the [Grove Encoder](https://www.seeedstudio.com/Grove-Encoder-p-1352.html).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `pin {Integer}` - the pin (D2-D7) to which the encoder is attached to.
|
||||
|
||||
**Returns**: `{Integer}` the current position of the encoder
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.flowEnable(pin = 2, period = 2000)`
|
||||
Enables the [Grove Water Flow Sensor](https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html).
|
||||
|
||||
This function literally counts the number of rising pulses in the given time period. Because of that, calling this is the same as calling `set_pin_interrupt(pin, ftype=COUNT_CHANGES, interrupt_mode=RISING, period=period)` for *pin*.
|
||||
|
||||
If the pin already has an associated interrupt event, calling this method will overwrite the setting with the new change for the given pin.
|
||||
|
||||
*This function will be removed from future versions and it's only kept for making the API backwards-compatible.*
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `pin {Integer}` the pin (D2-D8) to which the dust sensor is assigned to
|
||||
- `period {Integer}` refresh time frame for the dust sensor. Maximum value for this parameter is *65535* ms.
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.flowDisable(pin = 2)`
|
||||
Disables the [Grove Water Flow Sensor](https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html).
|
||||
|
||||
Necessary if you want to set output values to this pin with [grovepi.digitalWrite](../gpio/#grovepidigitalwritepin-value) function. It's the same as calling [unset_pin_interrupt](#grovepiunset_pin_interruptpin) function.
|
||||
|
||||
*This function will be removed from future versions and it's only kept for making the API backwards-compatible.*
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `pin {Integer}` the pin (D2-D8) to which the flow sensor is connected to
|
||||
|
||||
**Returns**: None
|
||||
|
||||
---
|
||||
|
||||
##`grovepi.flowRead(pin = 2)`
|
||||
Enables the [Grove Water Flow Sensor](https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html).
|
||||
|
||||
This function counts the number of rising pulses in the time period set with [grovepi.flowEnable](#grovepiflowenablepin-2-period-2000).
|
||||
|
||||
It's the same as calling [grovepi.read_interrupt_state](#grovepiread_interrupt_statepin) for the given pin.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `pin {Integer}` the pin (D2-D8) to which the flow sensor is connected to
|
||||
|
||||
**Returns**: `{Integer}` number of rising pulses that occurred within the given time frame
|
||||
7
docs/docs/dev/Dockerfile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
FROM python:alpine3.7
|
||||
|
||||
RUN pip install mkdocs mkdocs-material
|
||||
|
||||
WORKDIR /docs
|
||||
|
||||
CMD ["mkdocs", "serve", "--livereload", "-a", "0.0.0.0:8000"]
|
||||
19
docs/docs/dev/README.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Development Notes
|
||||
|
||||
To fire up a development environment for the documentation, you need to build this docker file first
|
||||
```
|
||||
docker image build -t dexterind/grovepi-docs .
|
||||
```
|
||||
|
||||
Once you have that, you need to fire up the container. First make sure you are running this from the root of this repository and then run
|
||||
```
|
||||
docker container run -v $(pwd)/docs:/docs -it --rm -p 80:8000 dexterind/grovepi-docs
|
||||
```
|
||||
|
||||
To have the documentation built run from the root of this repository
|
||||
```
|
||||
docker container run -v $(pwd)/docs:/docs -it --rm dexterind/grovepi-docs mkdocs build -c
|
||||
```
|
||||
and wait for it to exit the process and then copy the contents of the newly created directory `site` and place it into the `/docs` directory.
|
||||
|
||||
Enjoy developing and when you're done with it, build the documentation and save the statics in the docs folder.
|
||||
92
docs/docs/fw.md
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
## Flashing the Firmware
|
||||
|
||||
To flash the firmware, you must first have the GrovePi library/repository installed so for this you must follow the [Getting Started guide](quickstart.md#how-to-install).
|
||||
|
||||
Once the library is installed on the Raspberry Pi, run the following commands to have the firmware flashed onto the GrovePi:
|
||||
|
||||
```bash
|
||||
cd ~/Dexter/GrovePi/Firmware
|
||||
bash firmware_update.sh
|
||||
```
|
||||
This updates you to the latest version of the firmware which is the `1.4.0`.
|
||||
|
||||
---
|
||||
**NOTE TO OTHER LIBRARIES**
|
||||
|
||||
Because the `1.3.0` firmware was recently released, lots of other libraries written in other languages other than Python are yet to be updated, so
|
||||
they need to run on an older version of the firmware, specifically the `1.2.7`.
|
||||
|
||||
The `1.2.7` version can be found in `~/Dexter/GrovePi/Firmware/Archive` as `grove_pi_v1_2_7.cpp.hex`. If you need to run on this older version, follow these steps to burn the firmware:
|
||||
```bash
|
||||
mv ~/Dexter/GrovePi/Firmware/grove_pi_firmware.hex ~/Dexter/GrovePi/Firmware/grove_pi_v1_3_0.hex.bak
|
||||
cp ~/Dexter/GrovePi/Firmware/Archive/grove_pi_v1_2_7.cpp.hex ~/Dexter/GrovePi/Firmware/grove_pi_firmware.hex
|
||||
bash firmware_update.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Running Tests
|
||||
|
||||
To run the entire suite of tests for the GrovePi follow these bash instructions:
|
||||
```bash
|
||||
cd ~/Dexter/GrovePi/Troubleshooting
|
||||
sudo bash all_tests.sh
|
||||
```
|
||||
|
||||
At the end of this process you'll get a `log.txt` file on your Desktop at `~/Desktop/log.txt`.
|
||||
|
||||
Also, to see with which version of the firmware the library installed on the Raspberry Pi works with you can go to `~/Dexter/GrovePi` directory and run:
|
||||
```bash
|
||||
python grovepi.py
|
||||
```
|
||||
This should output a version number (of the GrovePi's firmware). Older versions of the firmware (<=`v1.2.7`) won't get displayed when calling `python grovepi.py`.
|
||||
```bash
|
||||
pi@raspberrypi:~ $ python grovepi.py
|
||||
library supports this fw versions: 1.4.0
|
||||
```
|
||||
|
||||
To see which is the version of the current firmware loaded on the GrovePi you can either run the above test (`... all_test.sh`) from the `Troubleshooting/` directory or you can run these commands:
|
||||
```python
|
||||
import grovepi
|
||||
print(grovepi.version())
|
||||
```
|
||||
|
||||
There are also cases when the GrovePi doesn't respond to requests. In this situation, you would normally see an exception appearing in Python. More often than not, these can be the source of problems:
|
||||
|
||||
- A non-present firmware on the GrovePi.
|
||||
- A mismatch of versions between the firmware and the library on the Raspberry Pi.
|
||||
|
||||
In both of these situations, re-flashing the firmware is all it's needed.
|
||||
|
||||
## Building the Firmware
|
||||
|
||||
There may be cases where additional modification to the firmware is required to accommodate someone's particular requirements. In this case,
|
||||
building the firmware and then uploading it is crucial. During our production, we use [PlatformIO](https://platformio.org/) along with [Atom IDE](https://atom.io/).
|
||||
|
||||
Once you get them both installed on your machine, open Atom IDE and add as a project the `/Firmware/Source/grovepi` directory. The added directory will have the following structure:
|
||||
|
||||
- `lib/`
|
||||
- `src/`
|
||||
- `.gitignore`
|
||||
- `.travis.yml`
|
||||
- `extra_script.py`
|
||||
- `platformio.ini`
|
||||
|
||||
Next, click on the build button or use **ALT-CTRL-B** key combination to build the firmware with PlatformIO. Once that it's done, head over to `/Firmware/Source/grovepi/.pioenvs/grovepi` directory and notice the `firmware.hex`. That's the firmware that was just built. You can then burn that to your GrovePi.
|
||||
|
||||
## Resetting the GrovePi
|
||||
|
||||
To reset the GrovePi from your Raspberry Pi, run the following command provided you have installed the GrovePi library on your image:
|
||||
```bash
|
||||
avrdude -c gpio -p m328p
|
||||
```
|
||||
|
||||
<!-- ## Enabling Software I2C
|
||||
|
||||
The GrovePi and the Raspberry Pi communicate over an I2C connection, but the problem with the Raspberry Pi's HW implementation has to do with the clock stretching mechanism. This mechanism is badly implemented and can lead to corrupted transfers with the GrovePi.
|
||||
|
||||
More details on this issue can be found on these tickets: [raspberrypi/linux/issues/254](https://github.com/raspberrypi/linux/issues/254) and [dexterind/grovepi/issues/411](https://github.com/DexterInd/GrovePi/issues/411).
|
||||
|
||||
In order to avoid having problems caused by the clock-stretching mechanism, you can use our bit-bang implementation of the I2C that uses the [RPi.GPIO](https://pypi.org/project/RPi.GPIO/) library. In order to have this alternative software I2C used instead, install the [DI-Sensors library](http://di-sensors.readthedocs.io/en/master/quickstart.html#how-to-install-the-di-sensors).
|
||||
|
||||
To check which I2C you're using, you can import the `grovepi` module and then check the value of `grovepi.whichI2C` attribute. If it's set to `"periphery"` then it means the HW I2C is used and otherwise if it's set to `"software"` then it's using the DI-Sensors' one which is bit-banged. -->
|
||||
28
docs/docs/hw.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||

|
||||
|
||||
## Port Layout
|
||||
|
||||
The GrovePi+ has multiple types of ports:
|
||||
|
||||
1. _Analog_ ports - **A0**, **A1**, **A2** - with these ports you can read the voltage output of sensors. In this diagram, these ports are coloured in blue.
|
||||
When using the ports with our API, only use integers to designate the port of your choice such as `0`, `1` or `2`.
|
||||
|
||||
2. _Digital_ ports - **D2**, **D3**, **D4**, **D5**, **D6**, **D7** ,**D8** - with these ports you can read and write digital values of 1 or 0. In the above
|
||||
diagram, these ports are coloured in orange. When using the ports with our API, only use integers to designate the port of your choice such as `2`, `3` ... `8`.
|
||||
|
||||
3. _PWM_ port - **3**, **5**, **6**, **9** - with these ports you can set a specific voltage output between 0V and 5V by using the concept of duty cycle / PWN / PPM.
|
||||
|
||||
4. _I2C_ ports - which are coloured in yellow and have the SDA & SCL acronyms written. The master of this connection is the Raspberry Pi.
|
||||
|
||||
5. _Serial_ ports - which are found in the bottom-left corner of the above diagram. _SERIAL_ port is the GrovePi's port whereas _RPISER_ is a bypass to the Raspberry Pi's port,
|
||||
which has a level converter implemented to accept 5V signals.
|
||||
|
||||
## Numbering System
|
||||
|
||||
Most of the sensors/actuators that we support have the signal line on the outwards of the grove port. For instance,
|
||||
the [Grove LED](https://www.seeedstudio.com/Grove-Red-LED-p-1142.html) has the signal line on the edge of the grove port which corresponds to port number 4 on port name _D4_,
|
||||
so for us this was the reason why the port names we have given actually depend on where the signal lines mostly reside.
|
||||
|
||||
Looking at a typical grove cable that comes with any GrovePi kit, the signal line is generally the yellow wire and the white
|
||||
wire is left unused. As you might have guessed, the yellow wire is the outermost wire of the grove cable.
|
||||
BIN
docs/docs/img/biglogo.jpg
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
docs/docs/img/dust_sensor_characteristics.jpg
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
docs/docs/img/favicon.ico
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
docs/docs/img/grovepi.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
docs/docs/img/logo.bmp
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docs/docs/img/rpi_hw.jpg
Normal file
|
After Width: | Height: | Size: 283 KiB |
BIN
docs/docs/img/sensors.PNG
Normal file
|
After Width: | Height: | Size: 569 KiB |
BIN
docs/docs/img/stackedgrovepi.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
22
docs/docs/index.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# GrovePi Documentation
|
||||
|
||||

|
||||
|
||||
The [GrovePi](https://www.dexterindustries.com/grovepi/) is a [Dexter Industries](https://www.dexterindustries.com) open-source platform for connecting Grove Sensors to the Raspberry Pi. With it you can
|
||||
bring the world of IoT devices to the Raspberry Pi and the only requirement for that is for you to know
|
||||
how to code in your language of choice.
|
||||
|
||||

|
||||
|
||||
Whether it's a humidity/temperature sensor, distance sensor or an IR receiver or something as basic as an LED,
|
||||
the GrovePi can be your answer to these questions.
|
||||
|
||||
By default, the language of choice for our library is Python, but support for other languages can be found too
|
||||
from our contributors such as:
|
||||
|
||||
* C/C++
|
||||
* NodeJS
|
||||
* Java
|
||||
* Go
|
||||
* Ruby
|
||||
* Scratch
|
||||
74
docs/docs/quickstart.md
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
## Stacking It
|
||||
|
||||
To get the GrovePi up and running we first need to attach the GrovePi to the RaspberryPi. It's
|
||||
a very simple process where it only needs to be stacked on top the GrovePi just like with any other hat.
|
||||
|
||||
Before powering the Pi up, you need to make sure there's no foam sticked to the headers as that
|
||||
can trigger the Raspberry Pi to reboot. That's because the foam is electrically conductive and it
|
||||
basically shorts the pins.
|
||||
|
||||
In the end the GrovePi will sit on the Raspberry Pi like in the following photo.
|
||||
|
||||

|
||||
|
||||
## How to Install
|
||||
|
||||
When it comes to installation there are 2 ways to do it:
|
||||
|
||||
1. By using our pre-made image called [Raspbian For Robots](https://sourceforge.net/projects/dexterindustriesraspbianflavor/).
|
||||
1. By using a fresh Raspbian image and running our install command.
|
||||
|
||||
#### For Raspbian For Robots Image
|
||||
|
||||
The benefit of using our image is that you don't have to worry about installing the GrovePi - because it's already on it.
|
||||
Still after a while you will be required to run updates via the console or via our GUI app in order to get the latest.
|
||||
|
||||
#### For Manual Installation
|
||||
|
||||
On the other hand, when using a fresh Raspbian image the initial installation takes some time, but subsequent updates take
|
||||
way less. The disadvantage with method is that you don't get the other robots installed too, so if you don't want to use
|
||||
other robots from our family then this method is the preferred one.
|
||||
|
||||
To install the GrovePi on a fresh image of Raspbian, run the following command:
|
||||
```bash
|
||||
curl -kL dexterindustries.com/update_grovepi | bash
|
||||
```
|
||||
|
||||
#### How to Update to a Newer Version
|
||||
|
||||
Regardless of how you got the GrovePi installed (manually or by getting the Raspbian For Robots image), there's only one way to update
|
||||
to the latest version:
|
||||
```bash
|
||||
curl -kL dexterindustries.com/update_grovepi | bash
|
||||
```
|
||||
|
||||
As you can see it's basically the same command used for installing the library on a fresh Raspbian image.
|
||||
|
||||
## Where Is It Installed
|
||||
|
||||
Upon installing the GrovePi or getting our flavored image the GrovePi library can be found in `/home/pi/Dexter/GrovePi` directory.
|
||||
|
||||
The `/home/pi/Dexter/GrovePi` is a mirrored version of [our GitHub repository](https://github.com/DexterInd/GrovePi/tree/master) of the master branch.
|
||||
|
||||
## What I2C Bus to Use
|
||||
|
||||
By default, the GrovePi library is set to use the `RPI_1SW` bus, which is a software implementation of the I2C specifically built to circumvent
|
||||
the issues with the hardware I2C of the Raspberry Pi. It's very fast and it doesn't use much CPU time at all. We recommend using this bus, thus,
|
||||
when importing the `grovepi` module, you don't have to do anything.
|
||||
|
||||
There's also the `RPI_1`, the classic HW I2C of the Raspberry Pi, which is buggy and unreliable. We don't see any reason in using this one in any scenario. Period.
|
||||
|
||||
In order to change the bus, presumably to `RPI_1` bus, call `grovepi.set_bus("RPI_1")` or `grovepi.set_bus("RPI_1SW")` in case you've changed the default one.
|
||||
|
||||
## Scratch Support
|
||||
|
||||
Scratch support comes by default with our flavored image, Raspbian For Robots, but if you find yourself to be using the classic Raspbian then
|
||||
you also need to run the following command after you have installed the GrovePi:
|
||||
```bash
|
||||
sudo bash /home/pi/Dexter/GrovePi/Script/install_scratch.sh
|
||||
```
|
||||
|
||||
## Community Support
|
||||
|
||||
To find out more on the GrovePi you can visit our forum and check for threads with the [grovepi tag](https://forum.dexterindustries.com/tags/grovepi)
|
||||
or by going to the [GrovePi category](https://forum.dexterindustries.com/c/grovepi).
|
||||
65
docs/docs/release-notes.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# Release Notes For the Firmware
|
||||
|
||||
## Maintenance Team
|
||||
|
||||
The current and past members of the GrovePi team in alphabetical order are:
|
||||
|
||||
- [@CleoQc](https://github.com/CleoQc)
|
||||
- [@johnisanerd](https://github.com/johnisanerd)
|
||||
- [@karan259](https://github.com/karan259)
|
||||
- [@RobertLucian](https://github.com/RobertLucian)
|
||||
|
||||
Also, we have a couple of notable contributors to the GrovePi but for other libraries:
|
||||
|
||||
- [@marcellobarile](https://github.com/marcellobarile) for the NodeJS library
|
||||
- [@mcauser](https://github.com/mcauser) for adding different new functionalities/bug fixes/examples to our current library
|
||||
- [@lanselambor](https://github.com/lanselambor)
|
||||
- [@nikkoura](https://github.com/nikkoura)
|
||||
- [@lucavallin](https://github.com/lucavallin) for coming with fixes to the Go library
|
||||
- [@rpedersen](https://github.com/rpedersen) for C# stuff
|
||||
- [@k33g](https://github.com/k33g) for Java library
|
||||
|
||||
## Version 1.4.0 - 27 April 2019
|
||||
|
||||
- Add support for setting up interrupt events on each digital port of the GrovePi, thus breaking the limit of just two available hardware interrupts [#446](https://github.com/DexterInd/GrovePi/pull/446)
|
||||
- Enable the Grove Dust Sensor, the Grove Encoder and the Grove Flow Meter to work on any digital port of the GrovePi and support 7 or 3 or respectively 7 devices at the same time [#446](https://github.com/DexterInd/GrovePi/pull/446)
|
||||
|
||||
## [Version 1.3.0](https://github.com/DexterInd/GrovePi/projects/2) - 1 Aug 2018
|
||||
|
||||
- Fixed synchronization bugs which led to very small IO rates
|
||||
|
||||
- Also caused values to overlap on other ports [#412](https://github.com/DexterInd/GrovePi/issues/412)
|
||||
- Caused I2C errors when functions were called with no delay between them [#409](https://github.com/DexterInd/GrovePi/issues/409)
|
||||
|
||||
- Small refactorization of the code to something slightly better
|
||||
- Fixed the dust sensor [#408](https://github.com/DexterInd/GrovePi/issues/408)
|
||||
- Mitigated abnormality caused by the Raspberry Pi not supporting clock stretching on the I2C [#411](https://github.com/DexterInd/GrovePi/issues/411)
|
||||
- Debugged and sped up the rate of acquisition of the DHT sensor [#418](https://github.com/DexterInd/GrovePi/issues/418)
|
||||
- Add IR receiver functionality for any remote control and fix inherent issues with the library [#416](https://github.com/DexterInd/GrovePi/issues/416)
|
||||
- Add option to set the flow meter and the dust sensor on different ports other than D2 [#421](https://github.com/DexterInd/GrovePi/issues/421)
|
||||
|
||||
## Version 1.2.7 - 20 Dec 2016
|
||||
|
||||
- Faster IO
|
||||
- Less IO Errors
|
||||
- RTC and MMA7xxx accelerometer code removed from the firmware
|
||||
|
||||
## Version 1.2.2 - 22 Jan 2015
|
||||
|
||||
- Grove Chainable RGB LED added
|
||||
- Ability to persist a RGB color in memory for later use
|
||||
|
||||
## Version 1.2.1 - 30 Dec 2014
|
||||
|
||||
- Grove 4 Digit Display added
|
||||
|
||||
## Version 1.2.0 - 29 Dec 2014
|
||||
|
||||
- Grove LED Bar added
|
||||
- Firmware version made available
|
||||
|
||||
## Version 1.1 - 13 Feb 2014
|
||||
|
||||
- DHT, ultrasonic, RTC code added
|
||||
- Support for multiple modules for same type added (Not tested)
|
||||
- Protocol made more robust
|
||||
10
docs/docs/supported.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Supported Modules
|
||||
|
||||
A [grid list of supported modules](https://www.dexterindustries.com/grovepi/) (sensors and actuators) can be seen on our page somewhere in the middle of it - you need to scroll down quite a lot.
|
||||
Upon scrolling down, you'll see a list that looks like this one down below.
|
||||
|
||||

|
||||
|
||||
# DI-Sensors
|
||||
|
||||
The GrovePi can also be used along with our [DI-Sensors](https://github.com/DexterInd/DI_Sensors/) that require an I2C interface. The GrovePi has 3 I2C ports which can be used for interfacing with these sensors. More can be found in the [DI-Sensors Documentation](http://di-sensors.readthedocs.io).
|
||||
666
docs/fw/index.html
Normal file
|
|
@ -0,0 +1,666 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/fw/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>Firmware Stuff - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#flashing-the-firmware" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Firmware Stuff
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href=".." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
Firmware Stuff
|
||||
</label>
|
||||
|
||||
<a href="./" title="Firmware Stuff" class="md-nav__link md-nav__link--active">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#flashing-the-firmware" title="Flashing the Firmware" class="md-nav__link">
|
||||
Flashing the Firmware
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#running-tests" title="Running Tests" class="md-nav__link">
|
||||
Running Tests
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#building-the-firmware" title="Building the Firmware" class="md-nav__link">
|
||||
Building the Firmware
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#resetting-the-grovepi" title="Resetting the GrovePi" class="md-nav__link">
|
||||
Resetting the GrovePi
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#flashing-the-firmware" title="Flashing the Firmware" class="md-nav__link">
|
||||
Flashing the Firmware
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#running-tests" title="Running Tests" class="md-nav__link">
|
||||
Running Tests
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#building-the-firmware" title="Building the Firmware" class="md-nav__link">
|
||||
Building the Firmware
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#resetting-the-grovepi" title="Resetting the GrovePi" class="md-nav__link">
|
||||
Resetting the GrovePi
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/fw.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1>Firmware Stuff</h1>
|
||||
|
||||
<h2 id="flashing-the-firmware">Flashing the Firmware<a class="headerlink" href="#flashing-the-firmware" title="Permanent link">¶</a></h2>
|
||||
<p>To flash the firmware, you must first have the GrovePi library/repository installed so for this you must follow the <a href="../quickstart/#how-to-install">Getting Started guide</a>.</p>
|
||||
<p>Once the library is installed on the Raspberry Pi, run the following commands to have the firmware flashed onto the GrovePi:</p>
|
||||
<div class="codehilite"><pre><span></span><span class="nb">cd</span> ~/Dexter/GrovePi/Firmware
|
||||
bash firmware_update.sh
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>This updates you to the latest version of the firmware which is the <code>1.4.0</code>.</p>
|
||||
<hr />
|
||||
<p><strong>NOTE TO OTHER LIBRARIES</strong></p>
|
||||
<p>Because the <code>1.3.0</code> firmware was recently released, lots of other libraries written in other languages other than Python are yet to be updated, so
|
||||
they need to run on an older version of the firmware, specifically the <code>1.2.7</code>.</p>
|
||||
<p>The <code>1.2.7</code> version can be found in <code>~/Dexter/GrovePi/Firmware/Archive</code> as <code>grove_pi_v1_2_7.cpp.hex</code>. If you need to run on this older version, follow these steps to burn the firmware:</p>
|
||||
<div class="codehilite"><pre><span></span>mv ~/Dexter/GrovePi/Firmware/grove_pi_firmware.hex ~/Dexter/GrovePi/Firmware/grove_pi_v1_3_0.hex.bak
|
||||
cp ~/Dexter/GrovePi/Firmware/Archive/grove_pi_v1_2_7.cpp.hex ~/Dexter/GrovePi/Firmware/grove_pi_firmware.hex
|
||||
bash firmware_update.sh
|
||||
</pre></div>
|
||||
|
||||
|
||||
<hr />
|
||||
<h2 id="running-tests">Running Tests<a class="headerlink" href="#running-tests" title="Permanent link">¶</a></h2>
|
||||
<p>To run the entire suite of tests for the GrovePi follow these bash instructions:</p>
|
||||
<div class="codehilite"><pre><span></span><span class="nb">cd</span> ~/Dexter/GrovePi/Troubleshooting
|
||||
sudo bash all_tests.sh
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>At the end of this process you'll get a <code>log.txt</code> file on your Desktop at <code>~/Desktop/log.txt</code>.</p>
|
||||
<p>Also, to see with which version of the firmware the library installed on the Raspberry Pi works with you can go to <code>~/Dexter/GrovePi</code> directory and run:</p>
|
||||
<div class="codehilite"><pre><span></span>python grovepi.py
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>This should output a version number (of the GrovePi's firmware). Older versions of the firmware (<=<code>v1.2.7</code>) won't get displayed when calling <code>python grovepi.py</code>.</p>
|
||||
<div class="codehilite"><pre><span></span>pi@raspberrypi:~ $ python grovepi.py
|
||||
library supports this fw versions: <span class="m">1</span>.4.0
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>To see which is the version of the current firmware loaded on the GrovePi you can either run the above test (<code>... all_test.sh</code>) from the <code>Troubleshooting/</code> directory or you can run these commands:</p>
|
||||
<div class="codehilite"><pre><span></span><span class="kn">import</span> <span class="nn">grovepi</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">grovepi</span><span class="o">.</span><span class="n">version</span><span class="p">())</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>There are also cases when the GrovePi doesn't respond to requests. In this situation, you would normally see an exception appearing in Python. More often than not, these can be the source of problems:</p>
|
||||
<ul>
|
||||
<li>A non-present firmware on the GrovePi.</li>
|
||||
<li>A mismatch of versions between the firmware and the library on the Raspberry Pi.</li>
|
||||
</ul>
|
||||
<p>In both of these situations, re-flashing the firmware is all it's needed.</p>
|
||||
<h2 id="building-the-firmware">Building the Firmware<a class="headerlink" href="#building-the-firmware" title="Permanent link">¶</a></h2>
|
||||
<p>There may be cases where additional modification to the firmware is required to accommodate someone's particular requirements. In this case,
|
||||
building the firmware and then uploading it is crucial. During our production, we use <a href="https://platformio.org/">PlatformIO</a> along with <a href="https://atom.io/">Atom IDE</a>.</p>
|
||||
<p>Once you get them both installed on your machine, open Atom IDE and add as a project the <code>/Firmware/Source/grovepi</code> directory. The added directory will have the following structure:</p>
|
||||
<ul>
|
||||
<li><code>lib/</code></li>
|
||||
<li><code>src/</code></li>
|
||||
<li><code>.gitignore</code></li>
|
||||
<li><code>.travis.yml</code></li>
|
||||
<li><code>extra_script.py</code></li>
|
||||
<li><code>platformio.ini</code></li>
|
||||
</ul>
|
||||
<p>Next, click on the build button or use <strong>ALT-CTRL-B</strong> key combination to build the firmware with PlatformIO. Once that it's done, head over to <code>/Firmware/Source/grovepi/.pioenvs/grovepi</code> directory and notice the <code>firmware.hex</code>. That's the firmware that was just built. You can then burn that to your GrovePi.</p>
|
||||
<h2 id="resetting-the-grovepi">Resetting the GrovePi<a class="headerlink" href="#resetting-the-grovepi" title="Permanent link">¶</a></h2>
|
||||
<p>To reset the GrovePi from your Raspberry Pi, run the following command provided you have installed the GrovePi library on your image:</p>
|
||||
<div class="codehilite"><pre><span></span>avrdude -c gpio -p m328p
|
||||
</pre></div>
|
||||
|
||||
|
||||
<!-- ## Enabling Software I2C
|
||||
|
||||
The GrovePi and the Raspberry Pi communicate over an I2C connection, but the problem with the Raspberry Pi's HW implementation has to do with the clock stretching mechanism. This mechanism is badly implemented and can lead to corrupted transfers with the GrovePi.
|
||||
|
||||
More details on this issue can be found on these tickets: [raspberrypi/linux/issues/254](https://github.com/raspberrypi/linux/issues/254) and [dexterind/grovepi/issues/411](https://github.com/DexterInd/GrovePi/issues/411).
|
||||
|
||||
In order to avoid having problems caused by the clock-stretching mechanism, you can use our bit-bang implementation of the I2C that uses the [RPi.GPIO](https://pypi.org/project/RPi.GPIO/) library. In order to have this alternative software I2C used instead, install the [DI-Sensors library](http://di-sensors.readthedocs.io/en/master/quickstart.html#how-to-install-the-di-sensors).
|
||||
|
||||
To check which I2C you're using, you can import the `grovepi` module and then check the value of `grovepi.whichI2C` attribute. If it's set to `"periphery"` then it means the HW I2C is used and otherwise if it's set to `"software"` then it's using the DI-Sensors' one which is bit-banged. -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../quickstart/" title="Getting Started" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Getting Started
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../hw/" title="Hardware Ports" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Hardware Ports
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
587
docs/hw/index.html
Normal file
|
|
@ -0,0 +1,587 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/hw/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>Hardware Ports - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#port-layout" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Hardware Ports
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href=".." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
Hardware Ports
|
||||
</label>
|
||||
|
||||
<a href="./" title="Hardware Ports" class="md-nav__link md-nav__link--active">
|
||||
Hardware Ports
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#port-layout" title="Port Layout" class="md-nav__link">
|
||||
Port Layout
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#numbering-system" title="Numbering System" class="md-nav__link">
|
||||
Numbering System
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#port-layout" title="Port Layout" class="md-nav__link">
|
||||
Port Layout
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#numbering-system" title="Numbering System" class="md-nav__link">
|
||||
Numbering System
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/hw.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1>Hardware Ports</h1>
|
||||
|
||||
<p><img alt="GrovePi+ Ports" src="../img/rpi_hw.jpg" /></p>
|
||||
<h2 id="port-layout">Port Layout<a class="headerlink" href="#port-layout" title="Permanent link">¶</a></h2>
|
||||
<p>The GrovePi+ has multiple types of ports:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p><em>Analog</em> ports - <strong>A0</strong>, <strong>A1</strong>, <strong>A2</strong> - with these ports you can read the voltage output of sensors. In this diagram, these ports are coloured in blue.
|
||||
When using the ports with our API, only use integers to designate the port of your choice such as <code>0</code>, <code>1</code> or <code>2</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>Digital</em> ports - <strong>D2</strong>, <strong>D3</strong>, <strong>D4</strong>, <strong>D5</strong>, <strong>D6</strong>, <strong>D7</strong> ,<strong>D8</strong> - with these ports you can read and write digital values of 1 or 0. In the above
|
||||
diagram, these ports are coloured in orange. When using the ports with our API, only use integers to designate the port of your choice such as <code>2</code>, <code>3</code> ... <code>8</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>PWM</em> port - <strong>3</strong>, <strong>5</strong>, <strong>6</strong>, <strong>9</strong> - with these ports you can set a specific voltage output between 0V and 5V by using the concept of duty cycle / PWN / PPM.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>I2C</em> ports - which are coloured in yellow and have the SDA & SCL acronyms written. The master of this connection is the Raspberry Pi.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><em>Serial</em> ports - which are found in the bottom-left corner of the above diagram. <em>SERIAL</em> port is the GrovePi's port whereas <em>RPISER</em> is a bypass to the Raspberry Pi's port,
|
||||
which has a level converter implemented to accept 5V signals.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h2 id="numbering-system">Numbering System<a class="headerlink" href="#numbering-system" title="Permanent link">¶</a></h2>
|
||||
<p>Most of the sensors/actuators that we support have the signal line on the outwards of the grove port. For instance,
|
||||
the <a href="https://www.seeedstudio.com/Grove-Red-LED-p-1142.html">Grove LED</a> has the signal line on the edge of the grove port which corresponds to port number 4 on port name <em>D4</em>,
|
||||
so for us this was the reason why the port names we have given actually depend on where the signal lines mostly reside.</p>
|
||||
<p>Looking at a typical grove cable that comes with any GrovePi kit, the signal line is generally the yellow wire and the white
|
||||
wire is left unused. As you might have guessed, the yellow wire is the outermost wire of the grove cable.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../fw/" title="Firmware Stuff" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Firmware Stuff
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../api/gpio/" title="GPIO Functions" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
GPIO Functions
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/img/biglogo.jpg
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
docs/img/dust_sensor_characteristics.jpg
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
docs/img/favicon.ico
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
docs/img/grovepi.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
docs/img/logo.bmp
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
docs/img/rpi_hw.jpg
Normal file
|
After Width: | Height: | Size: 283 KiB |
BIN
docs/img/sensors.PNG
Normal file
|
After Width: | Height: | Size: 569 KiB |
BIN
docs/img/stackedgrovepi.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
507
docs/index.html
Normal file
|
|
@ -0,0 +1,507 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#grovepi-documentation" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
About
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="." title="About" class="md-nav__link md-nav__link--active">
|
||||
About
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/index.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="grovepi-documentation">GrovePi Documentation<a class="headerlink" href="#grovepi-documentation" title="Permanent link">¶</a></h1>
|
||||
<p><img alt="DexterIndustries Logo" src="img/biglogo.jpg" /></p>
|
||||
<p>The <a href="https://www.dexterindustries.com/grovepi/">GrovePi</a> is a <a href="https://www.dexterindustries.com">Dexter Industries</a> open-source platform for connecting Grove Sensors to the Raspberry Pi. With it you can
|
||||
bring the world of IoT devices to the Raspberry Pi and the only requirement for that is for you to know
|
||||
how to code in your language of choice.</p>
|
||||
<p><img alt="GrovePi" src="img/grovepi.jpg" /></p>
|
||||
<p>Whether it's a humidity/temperature sensor, distance sensor or an IR receiver or something as basic as an LED,
|
||||
the GrovePi can be your answer to these questions.</p>
|
||||
<p>By default, the language of choice for our library is Python, but support for other languages can be found too
|
||||
from our contributors such as:</p>
|
||||
<ul>
|
||||
<li>C/C++</li>
|
||||
<li>NodeJS</li>
|
||||
<li>Java</li>
|
||||
<li>Go</li>
|
||||
<li>Ruby</li>
|
||||
<li>Scratch</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
|
||||
<a href="quickstart/" title="Getting Started" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Getting Started
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
40
docs/mkdocs.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
site_name: GrovePi Documentation
|
||||
site_url: https://dexterind.github.io/GrovePi
|
||||
site_description: Python documentation for the GrovePi
|
||||
site_author: DexterInd Team
|
||||
|
||||
repo_url: https://github.com/DexterInd/GrovePi
|
||||
repo_name: 'DexterInd/GrovePi'
|
||||
|
||||
theme:
|
||||
name: material
|
||||
favicon: 'img/favicon.ico'
|
||||
|
||||
extra:
|
||||
social:
|
||||
- type: 'github'
|
||||
link: 'https://github.com/DexterInd'
|
||||
- type: 'twitter'
|
||||
link: 'https://twitter.com/dexterind'
|
||||
|
||||
nav:
|
||||
- About: 'index.md'
|
||||
- Getting Started: 'quickstart.md'
|
||||
- Firmware Stuff: 'fw.md'
|
||||
- Hardware Ports: 'hw.md'
|
||||
- API Reference:
|
||||
- 'GPIO Functions': 'api/gpio.md'
|
||||
- 'General Sensors': 'api/general.md'
|
||||
- 'Complex Devices': 'api/complex.md'
|
||||
- 'Interrupt-Based Devices': 'api/interrupt.md'
|
||||
- Supported Modules: 'supported.md'
|
||||
- Release Notes: 'release-notes.md'
|
||||
|
||||
markdown_extensions:
|
||||
- admonition
|
||||
- codehilite:
|
||||
guess_lang: false
|
||||
- toc:
|
||||
permalink: true
|
||||
|
||||
copyright: Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
721
docs/quickstart/index.html
Normal file
|
|
@ -0,0 +1,721 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/quickstart/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>Getting Started - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#stacking-it" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Getting Started
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href=".." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
Getting Started
|
||||
</label>
|
||||
|
||||
<a href="./" title="Getting Started" class="md-nav__link md-nav__link--active">
|
||||
Getting Started
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#stacking-it" title="Stacking It" class="md-nav__link">
|
||||
Stacking It
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#how-to-install" title="How to Install" class="md-nav__link">
|
||||
How to Install
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#for-raspbian-for-robots-image" title="For Raspbian For Robots Image" class="md-nav__link">
|
||||
For Raspbian For Robots Image
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#for-manual-installation" title="For Manual Installation" class="md-nav__link">
|
||||
For Manual Installation
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#how-to-update-to-a-newer-version" title="How to Update to a Newer Version" class="md-nav__link">
|
||||
How to Update to a Newer Version
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#where-is-it-installed" title="Where Is It Installed" class="md-nav__link">
|
||||
Where Is It Installed
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#what-i2c-bus-to-use" title="What I2C Bus to Use" class="md-nav__link">
|
||||
What I2C Bus to Use
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#scratch-support" title="Scratch Support" class="md-nav__link">
|
||||
Scratch Support
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#community-support" title="Community Support" class="md-nav__link">
|
||||
Community Support
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#stacking-it" title="Stacking It" class="md-nav__link">
|
||||
Stacking It
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#how-to-install" title="How to Install" class="md-nav__link">
|
||||
How to Install
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#for-raspbian-for-robots-image" title="For Raspbian For Robots Image" class="md-nav__link">
|
||||
For Raspbian For Robots Image
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#for-manual-installation" title="For Manual Installation" class="md-nav__link">
|
||||
For Manual Installation
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#how-to-update-to-a-newer-version" title="How to Update to a Newer Version" class="md-nav__link">
|
||||
How to Update to a Newer Version
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#where-is-it-installed" title="Where Is It Installed" class="md-nav__link">
|
||||
Where Is It Installed
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#what-i2c-bus-to-use" title="What I2C Bus to Use" class="md-nav__link">
|
||||
What I2C Bus to Use
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#scratch-support" title="Scratch Support" class="md-nav__link">
|
||||
Scratch Support
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#community-support" title="Community Support" class="md-nav__link">
|
||||
Community Support
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/quickstart.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1>Getting Started</h1>
|
||||
|
||||
<h2 id="stacking-it">Stacking It<a class="headerlink" href="#stacking-it" title="Permanent link">¶</a></h2>
|
||||
<p>To get the GrovePi up and running we first need to attach the GrovePi to the RaspberryPi. It's
|
||||
a very simple process where it only needs to be stacked on top the GrovePi just like with any other hat.</p>
|
||||
<p>Before powering the Pi up, you need to make sure there's no foam sticked to the headers as that
|
||||
can trigger the Raspberry Pi to reboot. That's because the foam is electrically conductive and it
|
||||
basically shorts the pins.</p>
|
||||
<p>In the end the GrovePi will sit on the Raspberry Pi like in the following photo.</p>
|
||||
<p><img alt="Stacked GrovePi" src="../img/stackedgrovepi.jpg" /></p>
|
||||
<h2 id="how-to-install">How to Install<a class="headerlink" href="#how-to-install" title="Permanent link">¶</a></h2>
|
||||
<p>When it comes to installation there are 2 ways to do it:</p>
|
||||
<ol>
|
||||
<li>By using our pre-made image called <a href="https://sourceforge.net/projects/dexterindustriesraspbianflavor/">Raspbian For Robots</a>.</li>
|
||||
<li>By using a fresh Raspbian image and running our install command.</li>
|
||||
</ol>
|
||||
<h4 id="for-raspbian-for-robots-image">For Raspbian For Robots Image<a class="headerlink" href="#for-raspbian-for-robots-image" title="Permanent link">¶</a></h4>
|
||||
<p>The benefit of using our image is that you don't have to worry about installing the GrovePi - because it's already on it.
|
||||
Still after a while you will be required to run updates via the console or via our GUI app in order to get the latest.</p>
|
||||
<h4 id="for-manual-installation">For Manual Installation<a class="headerlink" href="#for-manual-installation" title="Permanent link">¶</a></h4>
|
||||
<p>On the other hand, when using a fresh Raspbian image the initial installation takes some time, but subsequent updates take
|
||||
way less. The disadvantage with method is that you don't get the other robots installed too, so if you don't want to use
|
||||
other robots from our family then this method is the preferred one.</p>
|
||||
<p>To install the GrovePi on a fresh image of Raspbian, run the following command:</p>
|
||||
<div class="codehilite"><pre><span></span>curl -kL dexterindustries.com/update_grovepi <span class="p">|</span> bash
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h4 id="how-to-update-to-a-newer-version">How to Update to a Newer Version<a class="headerlink" href="#how-to-update-to-a-newer-version" title="Permanent link">¶</a></h4>
|
||||
<p>Regardless of how you got the GrovePi installed (manually or by getting the Raspbian For Robots image), there's only one way to update
|
||||
to the latest version:</p>
|
||||
<div class="codehilite"><pre><span></span>curl -kL dexterindustries.com/update_grovepi <span class="p">|</span> bash
|
||||
</pre></div>
|
||||
|
||||
|
||||
<p>As you can see it's basically the same command used for installing the library on a fresh Raspbian image.</p>
|
||||
<h2 id="where-is-it-installed">Where Is It Installed<a class="headerlink" href="#where-is-it-installed" title="Permanent link">¶</a></h2>
|
||||
<p>Upon installing the GrovePi or getting our flavored image the GrovePi library can be found in <code>/home/pi/Dexter/GrovePi</code> directory.</p>
|
||||
<p>The <code>/home/pi/Dexter/GrovePi</code> is a mirrored version of <a href="https://github.com/DexterInd/GrovePi/tree/master">our GitHub repository</a> of the master branch.</p>
|
||||
<h2 id="what-i2c-bus-to-use">What I2C Bus to Use<a class="headerlink" href="#what-i2c-bus-to-use" title="Permanent link">¶</a></h2>
|
||||
<p>By default, the GrovePi library is set to use the <code>RPI_1SW</code> bus, which is a software implementation of the I2C specifically built to circumvent
|
||||
the issues with the hardware I2C of the Raspberry Pi. It's very fast and it doesn't use much CPU time at all. We recommend using this bus, thus,
|
||||
when importing the <code>grovepi</code> module, you don't have to do anything.</p>
|
||||
<p>There's also the <code>RPI_1</code>, the classic HW I2C of the Raspberry Pi, which is buggy and unreliable. Reasons to use RPI_1 are rare.</p>
|
||||
<p>In order to change the bus, presumably to <code>RPI_1</code> bus, call <code>grovepi.set_bus("RPI_1")</code> or <code>grovepi.set_bus("RPI_1SW")</code> in case you've changed the default one.</p>
|
||||
<h2 id="scratch-support">Scratch Support<a class="headerlink" href="#scratch-support" title="Permanent link">¶</a></h2>
|
||||
<p>Scratch support comes by default with our flavored image, Raspbian For Robots, but if you find yourself to be using the classic Raspbian then
|
||||
you also need to run the following command after you have installed the GrovePi:</p>
|
||||
<div class="codehilite"><pre><span></span>sudo bash /home/pi/Dexter/GrovePi/Script/install_scratch.sh
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h2 id="community-support">Community Support<a class="headerlink" href="#community-support" title="Permanent link">¶</a></h2>
|
||||
<p>To find out more on the GrovePi you can visit our forum and check for threads with the <a href="https://forum.dexterindustries.com/tags/grovepi">grovepi tag</a>
|
||||
or by going to the <a href="https://forum.dexterindustries.com/c/grovepi">GrovePi category</a>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href=".." title="About" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
About
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../fw/" title="Firmware Stuff" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Firmware Stuff
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
700
docs/release-notes/index.html
Normal file
|
|
@ -0,0 +1,700 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/release-notes/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>Release Notes - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#release-notes-for-the-firmware" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Release Notes
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href=".." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
Release Notes
|
||||
</label>
|
||||
|
||||
<a href="./" title="Release Notes" class="md-nav__link md-nav__link--active">
|
||||
Release Notes
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#maintenance-team" title="Maintenance Team" class="md-nav__link">
|
||||
Maintenance Team
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-140-27-april-2019" title="Version 1.4.0 - 27 April 2019" class="md-nav__link">
|
||||
Version 1.4.0 - 27 April 2019
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-130-1-aug-2018" title="Version 1.3.0 - 1 Aug 2018" class="md-nav__link">
|
||||
Version 1.3.0 - 1 Aug 2018
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-127-20-dec-2016" title="Version 1.2.7 - 20 Dec 2016" class="md-nav__link">
|
||||
Version 1.2.7 - 20 Dec 2016
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-122-22-jan-2015" title="Version 1.2.2 - 22 Jan 2015" class="md-nav__link">
|
||||
Version 1.2.2 - 22 Jan 2015
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-121-30-dec-2014" title="Version 1.2.1 - 30 Dec 2014" class="md-nav__link">
|
||||
Version 1.2.1 - 30 Dec 2014
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-120-29-dec-2014" title="Version 1.2.0 - 29 Dec 2014" class="md-nav__link">
|
||||
Version 1.2.0 - 29 Dec 2014
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-11-13-feb-2014" title="Version 1.1 - 13 Feb 2014" class="md-nav__link">
|
||||
Version 1.1 - 13 Feb 2014
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#maintenance-team" title="Maintenance Team" class="md-nav__link">
|
||||
Maintenance Team
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-140-27-april-2019" title="Version 1.4.0 - 27 April 2019" class="md-nav__link">
|
||||
Version 1.4.0 - 27 April 2019
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-130-1-aug-2018" title="Version 1.3.0 - 1 Aug 2018" class="md-nav__link">
|
||||
Version 1.3.0 - 1 Aug 2018
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-127-20-dec-2016" title="Version 1.2.7 - 20 Dec 2016" class="md-nav__link">
|
||||
Version 1.2.7 - 20 Dec 2016
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-122-22-jan-2015" title="Version 1.2.2 - 22 Jan 2015" class="md-nav__link">
|
||||
Version 1.2.2 - 22 Jan 2015
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-121-30-dec-2014" title="Version 1.2.1 - 30 Dec 2014" class="md-nav__link">
|
||||
Version 1.2.1 - 30 Dec 2014
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-120-29-dec-2014" title="Version 1.2.0 - 29 Dec 2014" class="md-nav__link">
|
||||
Version 1.2.0 - 29 Dec 2014
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#version-11-13-feb-2014" title="Version 1.1 - 13 Feb 2014" class="md-nav__link">
|
||||
Version 1.1 - 13 Feb 2014
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/release-notes.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="release-notes-for-the-firmware">Release Notes For the Firmware<a class="headerlink" href="#release-notes-for-the-firmware" title="Permanent link">¶</a></h1>
|
||||
<h2 id="maintenance-team">Maintenance Team<a class="headerlink" href="#maintenance-team" title="Permanent link">¶</a></h2>
|
||||
<p>The current and past members of the GrovePi team in alphabetical order are:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/CleoQc">@CleoQc</a></li>
|
||||
<li><a href="https://github.com/johnisanerd">@johnisanerd</a></li>
|
||||
<li><a href="https://github.com/karan259">@karan259</a></li>
|
||||
<li><a href="https://github.com/RobertLucian">@RobertLucian</a></li>
|
||||
</ul>
|
||||
<p>Also, we have a couple of notable contributors to the GrovePi but for other libraries:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/marcellobarile">@marcellobarile</a> for the NodeJS library</li>
|
||||
<li><a href="https://github.com/mcauser">@mcauser</a> for adding different new functionalities/bug fixes/examples to our current library</li>
|
||||
<li><a href="https://github.com/lanselambor">@lanselambor</a></li>
|
||||
<li><a href="https://github.com/nikkoura">@nikkoura</a></li>
|
||||
<li><a href="https://github.com/lucavallin">@lucavallin</a> for coming with fixes to the Go library</li>
|
||||
<li><a href="https://github.com/rpedersen">@rpedersen</a> for C# stuff</li>
|
||||
<li><a href="https://github.com/k33g">@k33g</a> for Java library</li>
|
||||
</ul>
|
||||
<h2 id="version-140-27-april-2019">Version 1.4.0 - 27 April 2019<a class="headerlink" href="#version-140-27-april-2019" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>Add support for setting up interrupt events on each digital port of the GrovePi, thus breaking the limit of just two available hardware interrupts <a href="https://github.com/DexterInd/GrovePi/pull/446">#446</a></li>
|
||||
<li>Enable the Grove Dust Sensor, the Grove Encoder and the Grove Flow Meter to work on any digital port of the GrovePi and support 7 or 3 or respectively 7 devices at the same time <a href="https://github.com/DexterInd/GrovePi/pull/446">#446</a></li>
|
||||
</ul>
|
||||
<h2 id="version-130-1-aug-2018"><a href="https://github.com/DexterInd/GrovePi/projects/2">Version 1.3.0</a> - 1 Aug 2018<a class="headerlink" href="#version-130-1-aug-2018" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Fixed synchronization bugs which led to very small IO rates</p>
|
||||
<ul>
|
||||
<li>Also caused values to overlap on other ports <a href="https://github.com/DexterInd/GrovePi/issues/412">#412</a></li>
|
||||
<li>Caused I2C errors when functions were called with no delay between them <a href="https://github.com/DexterInd/GrovePi/issues/409">#409</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>Small refactorization of the code to something slightly better</p>
|
||||
</li>
|
||||
<li>Fixed the dust sensor <a href="https://github.com/DexterInd/GrovePi/issues/408">#408</a></li>
|
||||
<li>Mitigated abnormality caused by the Raspberry Pi not supporting clock stretching on the I2C <a href="https://github.com/DexterInd/GrovePi/issues/411">#411</a></li>
|
||||
<li>Debugged and sped up the rate of acquisition of the DHT sensor <a href="https://github.com/DexterInd/GrovePi/issues/418">#418</a></li>
|
||||
<li>Add IR receiver functionality for any remote control and fix inherent issues with the library <a href="https://github.com/DexterInd/GrovePi/issues/416">#416</a></li>
|
||||
<li>Add option to set the flow meter and the dust sensor on different ports other than D2 <a href="https://github.com/DexterInd/GrovePi/issues/421">#421</a></li>
|
||||
</ul>
|
||||
<h2 id="version-127-20-dec-2016">Version 1.2.7 - 20 Dec 2016<a class="headerlink" href="#version-127-20-dec-2016" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>Faster IO</li>
|
||||
<li>Less IO Errors</li>
|
||||
<li>RTC and MMA7xxx accelerometer code removed from the firmware</li>
|
||||
</ul>
|
||||
<h2 id="version-122-22-jan-2015">Version 1.2.2 - 22 Jan 2015<a class="headerlink" href="#version-122-22-jan-2015" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>Grove Chainable RGB LED added</li>
|
||||
<li>Ability to persist a RGB color in memory for later use</li>
|
||||
</ul>
|
||||
<h2 id="version-121-30-dec-2014">Version 1.2.1 - 30 Dec 2014<a class="headerlink" href="#version-121-30-dec-2014" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>Grove 4 Digit Display added</li>
|
||||
</ul>
|
||||
<h2 id="version-120-29-dec-2014">Version 1.2.0 - 29 Dec 2014<a class="headerlink" href="#version-120-29-dec-2014" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>Grove LED Bar added</li>
|
||||
<li>Firmware version made available</li>
|
||||
</ul>
|
||||
<h2 id="version-11-13-feb-2014">Version 1.1 - 13 Feb 2014<a class="headerlink" href="#version-11-13-feb-2014" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>DHT, ultrasonic, RTC code added</li>
|
||||
<li>Support for multiple modules for same type added (Not tested)</li>
|
||||
<li>Protocol made more robust</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../supported/" title="Supported Modules" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Supported Modules
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
docs/search/search_index.json
Normal file
432
docs/site/404.html
Normal file
|
|
@ -0,0 +1,432 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="/GrovePi/img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/GrovePi/assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/GrovePi/assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/GrovePi/assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/api/interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="/GrovePi/release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
<h1>404 - Not found</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="/GrovePi/assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/GrovePi/assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"/GrovePi"}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1064
docs/site/api/complex/index.html
Normal file
724
docs/site/api/general/index.html
Normal file
|
|
@ -0,0 +1,724 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/api/general/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>General Sensors - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#api-general-sensors" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
General Sensors
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../.." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" checked>
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
General Sensors
|
||||
</label>
|
||||
|
||||
<a href="./" title="General Sensors" class="md-nav__link md-nav__link--active">
|
||||
General Sensors
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepitemppin-model10" title="grovepi.temp(pin, model='1.0')" class="md-nav__link">
|
||||
grovepi.temp(pin, model='1.0')
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiultrasonicreadpin" title="grovepi.ultrasonicRead(pin)" class="md-nav__link">
|
||||
grovepi.ultrasonicRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiversion" title="grovepi.version()" class="md-nav__link">
|
||||
grovepi.version()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidhtpin-module_type" title="grovepi.dht(pin, module_type)" class="md-nav__link">
|
||||
grovepi.dht(pin, module_type)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_read_signal" title="grovepi.ir_read_signal()" class="md-nav__link">
|
||||
grovepi.ir_read_signal()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_recv_pinpin" title="grovepi.ir_recv_pin(pin)" class="md-nav__link">
|
||||
grovepi.ir_recv_pin(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_is_data" title="grovepi.ir_is_data()" class="md-nav__link">
|
||||
grovepi.ir_is_data()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepitemppin-model10" title="grovepi.temp(pin, model='1.0')" class="md-nav__link">
|
||||
grovepi.temp(pin, model='1.0')
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiultrasonicreadpin" title="grovepi.ultrasonicRead(pin)" class="md-nav__link">
|
||||
grovepi.ultrasonicRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiversion" title="grovepi.version()" class="md-nav__link">
|
||||
grovepi.version()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidhtpin-module_type" title="grovepi.dht(pin, module_type)" class="md-nav__link">
|
||||
grovepi.dht(pin, module_type)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_read_signal" title="grovepi.ir_read_signal()" class="md-nav__link">
|
||||
grovepi.ir_read_signal()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_recv_pinpin" title="grovepi.ir_recv_pin(pin)" class="md-nav__link">
|
||||
grovepi.ir_recv_pin(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiir_is_data" title="grovepi.ir_is_data()" class="md-nav__link">
|
||||
grovepi.ir_is_data()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/api/general.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="api-general-sensors">API - General Sensors<a class="headerlink" href="#api-general-sensors" title="Permanent link">¶</a></h1>
|
||||
<p>In this section the Python API reference for diverse sensors is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.</p>
|
||||
<p>In this section, the API for the following sensors is described:</p>
|
||||
<ul>
|
||||
<li><a href="http://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/">Grove Temperature Sensor</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html">Grove Ultrasonic Sensor</a></li>
|
||||
<li><a href="http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/">DHT11</a></li>
|
||||
<li><a href="http://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/">DHT22</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a> necessary for the <a href="https://www.dexterindustries.com/shop/infrared-remote/">Infrared Remote</a></li>
|
||||
</ul>
|
||||
<hr />
|
||||
<p><strong>IMPORTANT</strong></p>
|
||||
<p>This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.</p>
|
||||
<p>In case you need to reset the GrovePi from your Raspberry Pi, <a href="../fw/#resetting-the-grovepi">check this section</a>.</p>
|
||||
<p>The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.</p>
|
||||
<hr />
|
||||
<h2 id="grovepitemppin-model10"><code>grovepi.temp(pin, model='1.0')</code><a class="headerlink" href="#grovepitemppin-model10" title="Permanent link">¶</a></h2>
|
||||
<p>Read temperature from the <a href="http://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/">Grove Temperature Sensor</a> on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (A0-A2) from which to do the reading</li>
|
||||
<li><code>model {String}</code> <code>"1.0"</code>, <code>"1.1"</code>, <code>"1.2"</code> depending on the used model</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Float}</code> number to represent the temperature in ºC</p>
|
||||
<hr />
|
||||
<h2 id="grovepiultrasonicreadpin"><code>grovepi.ultrasonicRead(pin)</code><a class="headerlink" href="#grovepiultrasonicreadpin" title="Permanent link">¶</a></h2>
|
||||
<p>Read the distance to an object with the <a href="https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html">Grove Ultrasonic Sensor</a> on the GrovePi.
|
||||
The closer it is to the targeted object, the faster the sample rate and slower when it's farther.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) from which to do the reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Integer}</code> number to represent the distance to the object in centimeters</p>
|
||||
<hr />
|
||||
<h2 id="grovepiversion"><code>grovepi.version()</code><a class="headerlink" href="#grovepiversion" title="Permanent link">¶</a></h2>
|
||||
<p>Read the version of the firmware.</p>
|
||||
<p><strong>Returns</strong>: a <code>{String}</code> representing the firmware version (i.e. <code>"1.2.7"</code>)</p>
|
||||
<hr />
|
||||
<h2 id="grovepidhtpin-module_type"><code>grovepi.dht(pin, module_type)</code><a class="headerlink" href="#grovepidhtpin-module_type" title="Permanent link">¶</a></h2>
|
||||
<p>Read the temperature and humidity on the GrovePi with one of the given modules.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) from which to do the reading</li>
|
||||
<li>
|
||||
<p><code>module_type {Integer}</code> a number to identify the model</p>
|
||||
<ul>
|
||||
<li><code>0</code> for <a href="http://wiki.seeedstudio.com/Grove-TemperatureAndHumidity_Sensor/">DHT11</a></li>
|
||||
<li><code>1</code> for <a href="http://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/">DHT22</a></li>
|
||||
<li><code>2</code> for DHT21</li>
|
||||
<li><code>3</code> for AM2301</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: a <code>{(Float, Float}</code> list where the 1st parameter is the temperature in ºC and the 2nd one is the humidity as a percentage.</p>
|
||||
<p><strong>On Error</strong>: it returns a <code>{(Float, Float)}</code> list containing <code>NaN</code>s. This happens when the sensor can't keep up with the demanded sample rate.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiir_read_signal"><code>grovepi.ir_read_signal()</code><a class="headerlink" href="#grovepiir_read_signal" title="Permanent link">¶</a></h2>
|
||||
<p>Get the decoded value from the <a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a>. For this you need to use a remote control of any kind. The preferred one we use is the <a href="https://www.dexterindustries.com/shop/infrared-remote/">Infrared Remote</a>.</p>
|
||||
<p>In order to use this function, you first need to call <a href="#grovepiir_recv_pinpin">grovepi.ir_recv_pin</a> function to bind the functionality to a given port.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: a 3-element list of this form <code>{(Integer, Integer, Integer)}</code></p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>The 1st element keeps an <code>{Integer}</code> corresponding to a certain brand:</p>
|
||||
<ul>
|
||||
<li><code>-1</code> for unknown and <code>0</code> for unused</li>
|
||||
<li>RC2, RC5, NEC, SONY, PANASONIC, JVC, SAMSUNG, WHYNTER, AIWA_RC_T501, LG, SANYO, MITSUBISHI, DISH, SHARP, DENON, PRONTO, LEGO_PF having values from <code>1</code> to <code>17</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>The 2nd element is a 16-bit address used by some Panasonic and Sharp remotes</p>
|
||||
</li>
|
||||
<li>The 3rd element is the 32-bit decoded value that can be used to identify which buttons were pressed - since there's no map for them you need to do it on a case-by-case basis</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h2 id="grovepiir_recv_pinpin"><code>grovepi.ir_recv_pin(pin)</code><a class="headerlink" href="#grovepiir_recv_pinpin" title="Permanent link">¶</a></h2>
|
||||
<p>Enable the <a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a> on a given port. Used in conjunction with <a href="#grovepiir_read_signal">grovepi.ir_read_signal</a> and <a href="#grovepiir_is_data">grovepi.ir_is_data</a>.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> The port (D2-D8) to which the IR receiver gets connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiir_is_data"><code>grovepi.ir_is_data()</code><a class="headerlink" href="#grovepiir_is_data" title="Permanent link">¶</a></h2>
|
||||
<p>Checks if there's available data coming from the <a href="https://www.seeedstudio.com/Grove-Infrared-Receiver-p-994.html">Grove IR Receiver</a>. Used in conjunction with <a href="#grovepiir_read_signal">grovepi.ir_read_signal</a> function.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: <code>True</code> or <code>False</code></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../gpio/" title="GPIO Functions" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
GPIO Functions
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../complex/" title="Complex Devices" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Complex Devices
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
659
docs/site/api/gpio/index.html
Normal file
|
|
@ -0,0 +1,659 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/api/gpio/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>GPIO Functions - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#api-gpio-functions" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
GPIO Functions
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../.." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" checked>
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
GPIO Functions
|
||||
</label>
|
||||
|
||||
<a href="./" title="GPIO Functions" class="md-nav__link md-nav__link--active">
|
||||
GPIO Functions
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalreadpin" title="grovepi.digitalRead(pin)" class="md-nav__link">
|
||||
grovepi.digitalRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalwritepin-value" title="grovepi.digitalWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.digitalWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogreadpin" title="grovepi.analogRead(pin)" class="md-nav__link">
|
||||
grovepi.analogRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogwritepin-value" title="grovepi.analogWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.analogWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepipinmodepin-mode" title="grovepi.pinMode(pin, mode)" class="md-nav__link">
|
||||
grovepi.pinMode(pin, mode)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../interrupt/" title="Interrupt-Based Devices" class="md-nav__link">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalreadpin" title="grovepi.digitalRead(pin)" class="md-nav__link">
|
||||
grovepi.digitalRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidigitalwritepin-value" title="grovepi.digitalWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.digitalWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogreadpin" title="grovepi.analogRead(pin)" class="md-nav__link">
|
||||
grovepi.analogRead(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepianalogwritepin-value" title="grovepi.analogWrite(pin, value)" class="md-nav__link">
|
||||
grovepi.analogWrite(pin, value)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepipinmodepin-mode" title="grovepi.pinMode(pin, mode)" class="md-nav__link">
|
||||
grovepi.pinMode(pin, mode)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/api/gpio.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="api-gpio-functions">API - GPIO Functions<a class="headerlink" href="#api-gpio-functions" title="Permanent link">¶</a></h1>
|
||||
<p>In this section the Python API reference for GPIO functions is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.</p>
|
||||
<hr />
|
||||
<p><strong>IMPORTANT</strong></p>
|
||||
<p>This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.</p>
|
||||
<p>In case you need to reset the GrovePi from your Raspberry Pi, <a href="../fw/#resetting-the-grovepi">check this section</a>.</p>
|
||||
<p>The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.</p>
|
||||
<hr />
|
||||
<h2 id="grovepidigitalreadpin"><code>grovepi.digitalRead(pin)</code><a class="headerlink" href="#grovepidigitalreadpin" title="Permanent link">¶</a></h2>
|
||||
<p>Reads whether a port's input is set high or low on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) from which to do the reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>0</code> or <code>1</code> depending on the input value</p>
|
||||
<hr />
|
||||
<h2 id="grovepidigitalwritepin-value"><code>grovepi.digitalWrite(pin, value)</code><a class="headerlink" href="#grovepidigitalwritepin-value" title="Permanent link">¶</a></h2>
|
||||
<p>Sets the output value to either <code>0</code> or <code>1</code> to a digital port on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) to which to do the writing</li>
|
||||
<li><code>value {Integer}</code> either <code>0</code> for 0 volts or <code>1</code> for maximum output voltage (usually 5 volts)</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>1</code> all the time</p>
|
||||
<hr />
|
||||
<h2 id="grovepianalogreadpin"><code>grovepi.analogRead(pin)</code><a class="headerlink" href="#grovepianalogreadpin" title="Permanent link">¶</a></h2>
|
||||
<p>Detect an input voltage as a value from a given port on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (A0-A2) from which to do the reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: a 10-bit <code>{Integer}</code> number that maps to the input voltage on the port</p>
|
||||
<hr />
|
||||
<h2 id="grovepianalogwritepin-value"><code>grovepi.analogWrite(pin, value)</code><a class="headerlink" href="#grovepianalogwritepin-value" title="Permanent link">¶</a></h2>
|
||||
<p>Set an output voltage on a PWM-enabled port by mapping the value to the desired voltage on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (ports 3, 5, 6, 9) to which to do the writing</li>
|
||||
<li><code>value {Integer}</code> an 8-bit number that maps from 0V to the referenced voltage of the GrovePi (5V)</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>1</code> all the time</p>
|
||||
<hr />
|
||||
<h2 id="grovepipinmodepin-mode"><code>grovepi.pinMode(pin, mode)</code><a class="headerlink" href="#grovepipinmodepin-mode" title="Permanent link">¶</a></h2>
|
||||
<p>Sets a port to be either an OUTPUT or an INPUT port on the GrovePi.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> a number to identify the port (D2-D8) to which to do the change</li>
|
||||
<li><code>mode {String}</code> <code>"OUTPUT"</code> for writing values or <code>"INPUT"</code> for reading</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>1</code> all the time</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Hardware Ports
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../general/" title="General Sensors" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
General Sensors
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
914
docs/site/api/interrupt/index.html
Normal file
|
|
@ -0,0 +1,914 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="no-js">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<meta name="description" content="Python documentation for the GrovePi">
|
||||
|
||||
|
||||
<link rel="canonical" href="https://dexterind.github.io/GrovePi/api/interrupt/">
|
||||
|
||||
|
||||
<meta name="author" content="DexterInd Team">
|
||||
|
||||
|
||||
<meta name="lang:clipboard.copy" content="Copy to clipboard">
|
||||
|
||||
<meta name="lang:clipboard.copied" content="Copied to clipboard">
|
||||
|
||||
<meta name="lang:search.language" content="en">
|
||||
|
||||
<meta name="lang:search.pipeline.stopwords" content="True">
|
||||
|
||||
<meta name="lang:search.pipeline.trimmer" content="True">
|
||||
|
||||
<meta name="lang:search.result.none" content="No matching documents">
|
||||
|
||||
<meta name="lang:search.result.one" content="1 matching document">
|
||||
|
||||
<meta name="lang:search.result.other" content="# matching documents">
|
||||
|
||||
<meta name="lang:search.tokenizer" content="[\s\-]+">
|
||||
|
||||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.1.2">
|
||||
|
||||
|
||||
|
||||
<title>Interrupt-Based Devices - GrovePi Documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/stylesheets/application.3020aac5.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../assets/javascripts/modernizr.01ccdecf.js"></script>
|
||||
|
||||
|
||||
|
||||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
|
||||
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body dir="ltr">
|
||||
|
||||
<svg class="md-svg">
|
||||
<defs>
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
|
||||
viewBox="0 0 416 448" id="__github">
|
||||
<path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
|
||||
8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
|
||||
18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
|
||||
19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
|
||||
18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
|
||||
304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
|
||||
2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
|
||||
38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
|
||||
37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
|
||||
82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
|
||||
1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
|
||||
0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
|
||||
30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
|
||||
46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
|
||||
99.5z" />
|
||||
</svg>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
|
||||
|
||||
<a href="#api-interrupt-based-devices" tabindex="1" class="md-skip">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid">
|
||||
<div class="md-flex">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-header-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch">
|
||||
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
|
||||
|
||||
<span class="md-header-nav__topic">
|
||||
GrovePi Documentation
|
||||
</span>
|
||||
<span class="md-header-nav__topic">
|
||||
Interrupt-Based Devices
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
|
||||
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
|
||||
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
|
||||
<label class="md-icon md-search__icon" for="__search"></label>
|
||||
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
|
||||

|
||||
</button>
|
||||
</form>
|
||||
<div class="md-search__output">
|
||||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||
<div class="md-search-result" data-md-component="result">
|
||||
<div class="md-search-result__meta">
|
||||
Type to start searching
|
||||
</div>
|
||||
<ol class="md-search-result__list"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<div class="md-header-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="md-container">
|
||||
|
||||
|
||||
|
||||
|
||||
<main class="md-main">
|
||||
<div class="md-main__inner md-grid" data-md-component="container">
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title md-nav__title--site" for="__drawer">
|
||||
<a href="https://dexterind.github.io/GrovePi" title="GrovePi Documentation" class="md-nav__button md-logo">
|
||||
|
||||
<i class="md-icon"></i>
|
||||
|
||||
</a>
|
||||
GrovePi Documentation
|
||||
</label>
|
||||
|
||||
<div class="md-nav__source">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/" title="Go to repository" class="md-source" data-md-source="github">
|
||||
|
||||
<div class="md-source__icon">
|
||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
||||
<use xlink:href="#__github" width="24" height="24"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="md-source__repository">
|
||||
DexterInd/GrovePi
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../.." title="About" class="md-nav__link">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../quickstart/" title="Getting Started" class="md-nav__link">
|
||||
Getting Started
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../fw/" title="Firmware Stuff" class="md-nav__link">
|
||||
Firmware Stuff
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../hw/" title="Hardware Ports" class="md-nav__link">
|
||||
Hardware Ports
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" checked>
|
||||
|
||||
<label class="md-nav__link" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
|
||||
<label class="md-nav__title" for="nav-5">
|
||||
API Reference
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../gpio/" title="GPIO Functions" class="md-nav__link">
|
||||
GPIO Functions
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../general/" title="General Sensors" class="md-nav__link">
|
||||
General Sensors
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../complex/" title="Complex Devices" class="md-nav__link">
|
||||
Complex Devices
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--active">
|
||||
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||||
Interrupt-Based Devices
|
||||
</label>
|
||||
|
||||
<a href="./" title="Interrupt-Based Devices" class="md-nav__link md-nav__link--active">
|
||||
Interrupt-Based Devices
|
||||
</a>
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period" title="grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)" class="md-nav__link">
|
||||
grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_pin_interruptpin" title="grovepi.unset_pin_interrupt(pin)" class="md-nav__link">
|
||||
grovepi.unset_pin_interrupt(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_all_interrupts" title="grovepi.unset_all_interrupts()" class="md-nav__link">
|
||||
grovepi.unset_all_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiis_interrupt_activepin" title="grovepi.is_interrupt_active(pin)" class="md-nav__link">
|
||||
grovepi.is_interrupt_active(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiget_active_interrupts" title="grovepi.get_active_interrupts()" class="md-nav__link">
|
||||
grovepi.get_active_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiread_interrupt_statepin" title="grovepi.read_interrupt_state(pin)" class="md-nav__link">
|
||||
grovepi.read_interrupt_state(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_enpin-2-period-30000" title="grovepi.dust_sensor_en(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_en(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_dispin-2" title="grovepi.dust_sensor_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.dust_sensor_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_readpin-2-period-30000" title="grovepi.dust_sensor_read(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_read(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_enpin-2-steps-32" title="grovepi.encoder_en(pin = 2, steps = 32)" class="md-nav__link">
|
||||
grovepi.encoder_en(pin = 2, steps = 32)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_dispin-2" title="grovepi.encoder_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoder_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoderreadpin-2" title="grovepi.encoderRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoderRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowenablepin-2-period-2000" title="grovepi.flowEnable(pin = 2, period = 2000)" class="md-nav__link">
|
||||
grovepi.flowEnable(pin = 2, period = 2000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowdisablepin-2" title="grovepi.flowDisable(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowDisable(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowreadpin-2" title="grovepi.flowRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../supported/" title="Supported Modules" class="md-nav__link">
|
||||
Supported Modules
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../release-notes/" title="Release Notes" class="md-nav__link">
|
||||
Release Notes
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<label class="md-nav__title" for="__toc">Table of contents</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period" title="grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)" class="md-nav__link">
|
||||
grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_pin_interruptpin" title="grovepi.unset_pin_interrupt(pin)" class="md-nav__link">
|
||||
grovepi.unset_pin_interrupt(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiunset_all_interrupts" title="grovepi.unset_all_interrupts()" class="md-nav__link">
|
||||
grovepi.unset_all_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiis_interrupt_activepin" title="grovepi.is_interrupt_active(pin)" class="md-nav__link">
|
||||
grovepi.is_interrupt_active(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiget_active_interrupts" title="grovepi.get_active_interrupts()" class="md-nav__link">
|
||||
grovepi.get_active_interrupts()
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiread_interrupt_statepin" title="grovepi.read_interrupt_state(pin)" class="md-nav__link">
|
||||
grovepi.read_interrupt_state(pin)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_enpin-2-period-30000" title="grovepi.dust_sensor_en(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_en(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_dispin-2" title="grovepi.dust_sensor_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.dust_sensor_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepidust_sensor_readpin-2-period-30000" title="grovepi.dust_sensor_read(pin = 2, period = 30000)" class="md-nav__link">
|
||||
grovepi.dust_sensor_read(pin = 2, period = 30000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_enpin-2-steps-32" title="grovepi.encoder_en(pin = 2, steps = 32)" class="md-nav__link">
|
||||
grovepi.encoder_en(pin = 2, steps = 32)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoder_dispin-2" title="grovepi.encoder_dis(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoder_dis(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiencoderreadpin-2" title="grovepi.encoderRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.encoderRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowenablepin-2-period-2000" title="grovepi.flowEnable(pin = 2, period = 2000)" class="md-nav__link">
|
||||
grovepi.flowEnable(pin = 2, period = 2000)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowdisablepin-2" title="grovepi.flowDisable(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowDisable(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#grovepiflowreadpin-2" title="grovepi.flowRead(pin = 2)" class="md-nav__link">
|
||||
grovepi.flowRead(pin = 2)
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="md-content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<a href="https://github.com/DexterInd/GrovePi/edit/master/docs/api/interrupt.md" title="Edit this page" class="md-icon md-content__icon"></a>
|
||||
|
||||
|
||||
<h1 id="api-interrupt-based-devices">API - Interrupt-Based Devices<a class="headerlink" href="#api-interrupt-based-devices" title="Permanent link">¶</a></h1>
|
||||
<p>In this section the Python API reference for interrupt-based devices is described. This library is supported on both major versions
|
||||
of Python: 2.x and 3.x.</p>
|
||||
<p>The API for the following sensors is described in this section:</p>
|
||||
<ul>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a></li>
|
||||
<li><a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a> of whose functionality can be used in other applications too</li>
|
||||
</ul>
|
||||
<p>Apart from describing the API for the above sensors, there is also described a set of functions used to set interrupt events on the GrovePi. These functions are like the building blocks of the API of the above sensors and can be used for your own implementation, should it be applicable to your device.</p>
|
||||
<hr />
|
||||
<p><strong>IMPORTANT</strong></p>
|
||||
<p>This library and the other ones too are not thread-safe. You cannot call the GrovePi from multiple threads or processes
|
||||
as that will put the GrovePi into a broken state.</p>
|
||||
<p>In case you need to reset the GrovePi from your Raspberry Pi, <a href="../../fw/#resetting-the-grovepi">check this section</a>.</p>
|
||||
<p>The functions don't verify if the input parameters are valid and therefore the parameters have to be verified/validated before that.
|
||||
Calling a function with improper parameters can result in an undefined behavior for the GrovePi.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiset_pin_interruptpin-ftype-interrupt_mode-period"><code>grovepi.set_pin_interrupt(pin, ftype, interrupt_mode, period)</code><a class="headerlink" href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period" title="Permanent link">¶</a></h2>
|
||||
<p>Attach an interrupt event to a port.</p>
|
||||
<p>Can be used to count pulses, duration of pulses, set different kinds of trigger modes (on change, rising or falling edges) all done within a given time period.</p>
|
||||
<p>If there are subsequent calls to this set function without detaching the interrupt event first from a given pin, then it will overwrite the old setting and update it to reflect the latest one.</p>
|
||||
<p>Also, setting this up disables the OUTPUT functionality on the selected pin. If the selected pin has to drive the output, then detach the interrupt event with <a href="#grovepiunset_pin_interruptpin">grovepi.unset_pin_interrupt</a>.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> can be pins D2-D8 to which the device is connected to</li>
|
||||
<li><code>ftype {Integer}</code> the type of event/operation associated for the given pin. Can take values <code>grovepi.COUNT_CHANGES</code> (for counting the number of triggers) or <code>grovepi.COUNT_LOW_DURATION</code> (which measures how much time the signal stays low in a given period).</li>
|
||||
<li><code>interrupt_mode {Integer}</code> triggering mode of the interrupt. It can be <code>grovepi.CHANGE</code>, <code>grovepi.FALLING</code> or <code>grovepi.RISING</code>, just like on the Arduino.</li>
|
||||
<li><code>period {Integer}</code> specifying after how long the recorded value should be stored on the GrovePi to be subsequently read on the master device (Raspberry Pi). Measured in milliseconds. Minimum value shouldn't be too small (say under <em>5 ms</em>) and the maximum value is <em>65535 ms</em>.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiunset_pin_interruptpin"><code>grovepi.unset_pin_interrupt(pin)</code><a class="headerlink" href="#grovepiunset_pin_interruptpin" title="Permanent link">¶</a></h2>
|
||||
<p>Detach an interrupt event from a given pin.</p>
|
||||
<p>Necessary if you want to set output values to this pin with <a href="../gpio/#grovepidigitalwritepin-value">grovepi.digitalWrite</a> function.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> pins D2-D8 from which the interrupt is released from</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiunset_all_interrupts"><code>grovepi.unset_all_interrupts()</code><a class="headerlink" href="#grovepiunset_all_interrupts" title="Permanent link">¶</a></h2>
|
||||
<p>Detach all active interrupt events on all pins.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiis_interrupt_activepin"><code>grovepi.is_interrupt_active(pin)</code><a class="headerlink" href="#grovepiis_interrupt_activepin" title="Permanent link">¶</a></h2>
|
||||
<p>Check if a pin has an interrupt event associated.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> pin to check (D2-D8) if there's an associated interrupt event</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Bool}</code> - <code>True</code> if it has an interrupt event associated and <code>False</code> if otherwise.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiget_active_interrupts"><code>grovepi.get_active_interrupts()</code><a class="headerlink" href="#grovepiget_active_interrupts" title="Permanent link">¶</a></h2>
|
||||
<p>Get a list of all pins that have associated interrupt events.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<p><strong>Returns</strong>: A list of integers representing the active pins that have interrupt events.</p>
|
||||
<hr />
|
||||
<h2 id="grovepiread_interrupt_statepin"><code>grovepi.read_interrupt_state(pin)</code><a class="headerlink" href="#grovepiread_interrupt_statepin" title="Permanent link">¶</a></h2>
|
||||
<p>Get the recorded value by the interrupt event on the given pin.</p>
|
||||
<p>If an interrupt is set on pin D2 (D2 is taken as an example, it can be any other digital pin) with the type of operation set to <code>grovepi.COUNT_CHANGES</code> and mode of interrupt set to <code>grovepi.RISING</code> with a period set to <em>1000 ms</em>, then say if 567 rising edges are detected, then at the end of this period of <em>1000 ms</em>, this function will return for pin D2 value 567. And the returned value of this function on D2 pin will update every <em>1000 ms</em>, because that's the period that has been set for it. And the outcome varies depending on how the interrupt event is initially set.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> pin to check the recorded value for the associated interrupt event</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Bool}</code> - <code>True</code> if it has an interrupt event associated and <code>False</code> if otherwise.</p>
|
||||
<hr />
|
||||
<h2 id="grovepidust_sensor_enpin-2-period-30000"><code>grovepi.dust_sensor_en(pin = 2, period = 30000)</code><a class="headerlink" href="#grovepidust_sensor_enpin-2-period-30000" title="Permanent link">¶</a></h2>
|
||||
<p>Enables the <a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a>.</p>
|
||||
<p>If there is another interrupt event set on this pin, calling this method will overwrite the previous setting. Check <a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period">grovepi.set_pin_interrupt</a> to find out more. It's the same effect as with calling this after calling <a href="#grovepiencoder_enpin-2-steps-32">grovepi.encoder_en</a> or <a href="#grovepiflowenablepin-2-period-2000">grovepi.flowEnable</a>. </p>
|
||||
<p>This function is the same as calling <code>set_pin_interrupt(pin, ftype=COUNT_LOW_DURATION, interrupt_mode=CHANGE, period=period)</code>.</p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the dust sensor is assigned to</li>
|
||||
<li><code>period {Integer}</code> refresh time frame for the dust sensor. Maximum value for this parameter is <em>65535</em> ms.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepidust_sensor_dispin-2"><code>grovepi.dust_sensor_dis(pin = 2)</code><a class="headerlink" href="#grovepidust_sensor_dispin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Disables the <a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a>.</p>
|
||||
<p>To disable the dust sensor that sits on the given pin. It's the same as calling <a href="#grovepiunset_pin_interruptpin">unset_pin_interrupt</a> function. </p>
|
||||
<p><em>This function will be removed from future versions and it's only kept for making the API backwards-compatible.</em></p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the dust sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepidust_sensor_readpin-2-period-30000"><code>grovepi.dust_sensor_read(pin = 2, period = 30000)</code><a class="headerlink" href="#grovepidust_sensor_readpin-2-period-30000" title="Permanent link">¶</a></h2>
|
||||
<p>Reads the low pulse occupancy of the <a href="https://www.seeedstudio.com/Grove-Dust-Sensor%EF%BC%88PPD42NS%EF%BC%89-p-1050.html">Grove Dust Sensor</a> in the given period of time as set with <a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period">grovepi.set_pin_interrupt</a> function.</p>
|
||||
<p><strong>Parameters</strong>: None</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> - the pin (D2-D8) to which the dust sensor is connected to</li>
|
||||
<li><code>period {Integer}</code> - refresh time frame for the dust sensor as set with <a href="#grovepiset_pin_interruptpin-ftype-interrupt_mode-period">grovepi.set_pin_interrupt</a> function. Maximum value for this parameter is <em>65535</em> ms.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{(Integer, Float, Float)}</code> list</p>
|
||||
<ul>
|
||||
<li>1st element is the LPO time</li>
|
||||
<li>the 2nd one is the percentage (LPO time divided by total period)</li>
|
||||
<li>the 3rd is the concentration as measured in <em>pcs/283ml=0.01cf</em> where the particle size is over <em>1um</em></li>
|
||||
</ul>
|
||||
<p>The dust sensor's characteristics can be seen in the following graph.</p>
|
||||
<p><img alt="Grove Dust Sensor Characteristics" src="../../img/dust_sensor_characteristics.jpg" /></p>
|
||||
<hr />
|
||||
<h2 id="grovepiencoder_enpin-2-steps-32"><code>grovepi.encoder_en(pin = 2, steps = 32)</code><a class="headerlink" href="#grovepiencoder_enpin-2-steps-32" title="Permanent link">¶</a></h2>
|
||||
<p>Enable the <a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a>.</p>
|
||||
<p>If the pin already has an associated interrupt event, calling this method will overwrite the setting with the new change for the given pin.</p>
|
||||
<p>Since the encoder needs two interrupt-enabled pins, when calling this function for a <em>pin</em>, it also attaches the next pin in line <em>pin + 1</em>. To see which pins have been attached, call <a href="#grovepiget_active_interrupts">get_active_interrupts</a> function.</p>
|
||||
<p><strong>Parameters</strong>: </p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>pin {Integer}</code> the pin to which the encoder is connected to. It also attaches the pin right next up in its line <em>pin + 1</em>. Can be set for D2-D7 pins. Notice how the last one can't be used because there would have to be another pin available after it, but there isn't because it's the last one in the chain.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>steps {Integer}</code> specifies the number of steps for the encoder</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiencoder_dispin-2"><code>grovepi.encoder_dis(pin = 2)</code><a class="headerlink" href="#grovepiencoder_dispin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Disable the <a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a>.</p>
|
||||
<p>Necessary if you want to set output values to this pin with <a href="../gpio/#grovepidigitalwritepin-value">grovepi.digitalWrite</a> function. It's the same as calling <a href="#grovepiunset_pin_interruptpin">unset_pin_interrupt</a> function for <em>pin</em> and <em>pin + 1</em>. </p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the flow sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiencoderreadpin-2"><code>grovepi.encoderRead(pin = 2)</code><a class="headerlink" href="#grovepiencoderreadpin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Read the data off of the <a href="https://www.seeedstudio.com/Grove-Encoder-p-1352.html">Grove Encoder</a>.</p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> - the pin (D2-D7) to which the encoder is attached to.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Integer}</code> the current position of the encoder</p>
|
||||
<hr />
|
||||
<h2 id="grovepiflowenablepin-2-period-2000"><code>grovepi.flowEnable(pin = 2, period = 2000)</code><a class="headerlink" href="#grovepiflowenablepin-2-period-2000" title="Permanent link">¶</a></h2>
|
||||
<p>Enables the <a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a>.</p>
|
||||
<p>This function literally counts the number of rising pulses in the given time period. Because of that, calling this is the same as calling <code>set_pin_interrupt(pin, ftype=COUNT_CHANGES, interrupt_mode=RISING, period=period)</code> for <em>pin</em>.</p>
|
||||
<p>If the pin already has an associated interrupt event, calling this method will overwrite the setting with the new change for the given pin.</p>
|
||||
<p><em>This function will be removed from future versions and it's only kept for making the API backwards-compatible.</em></p>
|
||||
<p><strong>Parameters</strong></p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the dust sensor is assigned to</li>
|
||||
<li><code>period {Integer}</code> refresh time frame for the dust sensor. Maximum value for this parameter is <em>65535</em> ms.</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiflowdisablepin-2"><code>grovepi.flowDisable(pin = 2)</code><a class="headerlink" href="#grovepiflowdisablepin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Disables the <a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a>.</p>
|
||||
<p>Necessary if you want to set output values to this pin with <a href="../gpio/#grovepidigitalwritepin-value">grovepi.digitalWrite</a> function. It's the same as calling <a href="#grovepiunset_pin_interruptpin">unset_pin_interrupt</a> function.</p>
|
||||
<p><em>This function will be removed from future versions and it's only kept for making the API backwards-compatible.</em></p>
|
||||
<p><strong>Parameters</strong>: </p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the flow sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: None</p>
|
||||
<hr />
|
||||
<h2 id="grovepiflowreadpin-2"><code>grovepi.flowRead(pin = 2)</code><a class="headerlink" href="#grovepiflowreadpin-2" title="Permanent link">¶</a></h2>
|
||||
<p>Enables the <a href="https://www.seeedstudio.com/M11%2A1.25-Water-Flow-Sensor-p-1345.html">Grove Water Flow Sensor</a>.</p>
|
||||
<p>This function counts the number of rising pulses in the time period set with <a href="#grovepiflowenablepin-2-period-2000">grovepi.flowEnable</a>.</p>
|
||||
<p>It's the same as calling <a href="#grovepiread_interrupt_statepin">grovepi.read_interrupt_state</a> for the given pin.</p>
|
||||
<p><strong>Parameters</strong>:</p>
|
||||
<ul>
|
||||
<li><code>pin {Integer}</code> the pin (D2-D8) to which the flow sensor is connected to</li>
|
||||
</ul>
|
||||
<p><strong>Returns</strong>: <code>{Integer}</code> number of rising pulses that occurred within the given time frame</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid">
|
||||
|
||||
<a href="../complex/" title="Complex Devices" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Previous
|
||||
</span>
|
||||
Complex Devices
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../../supported/" title="Supported Modules" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
||||
<span class="md-flex__ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
Next
|
||||
</span>
|
||||
Supported Modules
|
||||
</span>
|
||||
</div>
|
||||
<div class="md-flex__cell md-flex__cell--shrink">
|
||||
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-meta md-typeset">
|
||||
<div class="md-footer-meta__inner md-grid">
|
||||
<div class="md-footer-copyright">
|
||||
|
||||
<div class="md-footer-copyright__highlight">
|
||||
Maintained by the <a href="/release-notes/#maintenance-team">DexterInd Team</a>.
|
||||
</div>
|
||||
|
||||
powered by
|
||||
<a href="https://www.mkdocs.org">MkDocs</a>
|
||||
and
|
||||
<a href="https://squidfunk.github.io/mkdocs-material/">
|
||||
Material for MkDocs</a>
|
||||
</div>
|
||||
|
||||
<div class="md-footer-social">
|
||||
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
|
||||
|
||||
<a href="https://github.com/DexterInd" class="md-footer-social__link fa fa-github"></a>
|
||||
|
||||
<a href="https://twitter.com/dexterind" class="md-footer-social__link fa fa-twitter"></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../../assets/javascripts/application.267712eb.js"></script>
|
||||
|
||||
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
4
docs/site/assets/fonts/font-awesome.css
vendored
Normal file
13
docs/site/assets/fonts/material-icons.css
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/*!
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy
|
||||
* of the License at:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
|
||||
* DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
* SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
|
||||
* LIMITATIONS UNDER THE LICENSE.
|
||||
*/@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")}
|
||||