slackããRaspberry Piã«åããã¦ã¿ã
Dç´ã¢ã³ã
ç§æã§ãããªãã®ãè¦ã¤ããã
Dç´ã¢ã³ãã¨ãã£ã¦ãã¢ããã°ã§ã¯ãªãPWMã§å¢å¹
ãããããã
以åãRaspberry Piã«100åã§è²·ã£ãã¹ãã¼ã«ã¼ãã¤ãã¦é³å£°ãåçããã¦ã¿ããããã¾ãã«ãé³ãå°ãããã¦ä½¿ãç©ã«ãªããªãã£ãã
ä»åã¯ããã®Dç´ã¢ã³ãã¢ã¸ã¥ã¼ã«ã使ã£ã¦ãRaspberry Piã®é³å£°åçã«ãªãã³ã¸ãã¦ã¿ãã
ææ
ææã¯ä¸è¨ã®éã
- PAï¼ï¼ï¼ï¼ï¼ä½¿ç¨ï¼ã¯ããDç´ã¢ã³ãã¢ã¸ã¥ã¼ã«
- 100åã®ãã«ããç¨ã±ã¼ã¹
- 100åã®USBå é»ã±ã¼ãã«
- ï¼ï¼ï¼ï½ï½ã¹ãã¬ãªã¸ã£ãã¯
- é ç·å°ã
ä»åã¯ã¢ã³ãã¢ã¸ã¥ã¼ã«ã¨ãªã¼ãã£ãªå
¥åã¸ã£ãã¯ã¨ã¹ãã¼ã«ã¼åºåã¸ã£ãã¯ãé
ç·ããã ãã®ã·ã³ãã«ãªåè·¯ã«ãªã£ãã
æ¬å½ã¯ãå¯å¤æµæãä»ãã¦ããªã¥ã¼ã 調æ´åºæ¥ãããã«ãããã£ããã調éããæµæã®å¤§ãã(?)ãééãã¦ãã¾ã£ãã®ã§è«¦ããã
Dç´ã¢ã³ãã¢ã¸ã¥ã¼ã«èªä½ã1cmåæ¹ç¨åº¦ã®ãµã¤ãºããç¡ããããã±ã¼ã¹ã¯ãªãã¹ãå°ããã«ãããã¨æã£ãã
ããããããããã¿ããã¼ã¿ãããªã®ã¯ã¤ã±ã¦ãªãã¨æã£ãã®ã§ããã«ããç¨ã±ã¼ã¹ã«ãã¦ã¿ãï¼çµå±100åã ãï¼
ããã«é¨åãé ç·ãããã®
ãããã¹ã«ã¹ã«â¦
é»æºã¯ã常æ稼åãããã®ã§USB(5V)ããåã£ã¦ããã
ã¾ããé³æ¥½åçãªã©ã«ä½¿ãã¤ããã¯ãªãã®ã§ããã¤ãºå¯¾çã®ã³ã³ãã³ãµãã¤ããªãã£ãããã¹ãã¬ãªã¸ã£ãã¯ã ã£ããã©ã¢ãã©ã«åãããããã
ã¢ã³ãå®æ
ãã¿ããã¦ã¹ãã¼ã«ã¼ã¨Raspberry Piã¨ãç¹ãã§ãã¼ãã¦ã§ã¢ã¯å®æï¼
ã¡ãªã¿ã«ç©ºã缶ã¹ãã¼ã«ã¼ã¯ããªããã®ã¤ãã³ãã§è²·ã£ãç©ã
slack + hubot + AquesTalk
ã½ããã¦ã§ã¢å´ã®å®è£ ã ãã以åãé³å£°åæããããã¨ãããã®ã§åçã®ããã®æºåã¯æ´ã£ã¦ããã
ä»åã¯ãslackçµç±ã§hubotã«AquesTalkãå©ããã¦åãããã¹ã¯ãªãããç¨æãã¦å®æã
# Description # AquesTalkã§åããã # Commands: # hubot talk <message> child_process = require 'child_process' module.exports = (robot) -> robot.respond /talk (.*)/i, (msg) -> child_process.exec process.env.AQUESTALK_PATH + "/AquesTalkPi " + msg.match[1] + " | aplay -q", (error, stdout, stderr) -> if !error msg.reply 'OK' else msg.reply error
ç°å¢å¤æ°AQUESTALK_PATHã«ã¯AquesTalkã®ãã¹ãæå®ãããã¨ã
使ãæ¹ã¯ã·ã³ãã«ã§ãhubotã«å¯¾ãã¦talk "ã¡ãã»ã¼ã¸"ã§ãã¹ãã¼ã«ã¼ããé³å£°åæ(ãã£ãããã¤ã¹)ã§åã£ã¦ãããã
ç¨é
ç¾å¨ãslackã¨hubotã§ããæ¯æéé¨å±ã®æ¸©æ¹¿åº¦ãéç¥ããã·ã¹ãã ãã¨ããã´ãæ¨ã¦ã®æ¥ãéç¥ããã·ã¹ãã ããéç¨ãã¦ãããã温湿度ã®éç¥ã«ã´ãæ¨ã¦ã®éç¥ãåããã¦æ°ã¥ããªãäºãç¨ã«ãããã£ãã
ãã®ãããä»åslackã®éç¥ã¨ã¯å¥ã®éç¥æ¹æ³ã¨ãã¦é³å£°åæã§åããããã¨ã«ãã¦ã¿ãã
ã¨ãããããã°ããéç¨ãã¦ã¿ãã