Created
December 26, 2014 06:12
-
-
Save bathtimefish/7b1e2ab0889f917588b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Tesselで人感センサー | |
* 通常在庫商品 焦電型赤外線センサーモジュール SB612A | |
* http://akizukidenshi.com/catalog/g/gM-08767/ | |
* TesselのGPIO電源は3.3vのみなので3.3vでいけるモーションセンサーが必要なため | |
* 配線のためのデータシート http://akizukidenshi.com/download/ds/senba/SB612A-Advanced.pdf | |
* TesselのGPIO配置 https://s3.amazonaws.com/technicalmachine-assets/doc+pictures/hardware_design_docs/gpio-pins.jpg | |
* | |
* [配線] | |
* Tessel --- SB612A | |
* 3.3v(3) --- VCC(+) | |
* GND(1) --- GND(-) | |
* G3 (19) --- TEST | |
* | |
* [memo] | |
* G3が tessel.port['GPIO'].digital[2] である | |
* 5vのセンサーしか持ってないので正確に検知できなかったけど | |
* それっぽい値がでたのでプログラムはこれでいけるはず。 | |
*/ | |
var tessel = require('tessel'); | |
var gpio = tessel.port['GPIO']; | |
var motion = gpio.digital[2]; // G3 19 | |
motion.input(); | |
setInterval(function() { | |
console.log(motion.read()); | |
}, 1000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment