対象èªè
ãIoTã«èå³ããããJavaScriptã®åºæ¬çãªç¥èãããæ¹ã対象ã¨ãã¾ãã
ã¯ããã«
ãä»åã¯ãã¯ã³ãã¼ããã¤ã³ã³Tessel 2ã®éçºç°å¢ã®æ§ç¯ã¨ãLEDãå ãããï¼ããããLãã«ï¼ã¨ããã¾ã§ãç´¹ä»ãã¾ãã
IoTã¨Tessel 2
ãIoTã¨ã¯ããã¯ã説æããã¾ã§ãããã¾ããããInternet of Thingsï¼ã¢ãã®ã¤ã³ã¿ã¼ãããï¼ã®ç¥ç§°ã§ãPCãªã©ã«éããããããããã¢ãããã¤ã³ã¿ã¼ãããã«ã¤ãªãããç¸äºã«å¶å¾¡ããä»çµã¿ã®ãã¨ã§ãããã®æ¦å¿µèªä½ã¯ãç¹ã«æ°ããã¨ããããã§ã¯ãªããã®ã®ãæè¿å¤§ããªæ³¨ç®ãéãã¦ãã¾ãã
ããã¼ãã¦ã§ã¢ï¼ããã¤ã¹ï¼ãè¶ å°åã§é«æ§è½ã«ãªããããã¤ã¹ä¸ã§ã®å¦çãããã°ã©ã éçºã®å¶éããªããªã£ã¦ãããã¨ããIoTãã¼ã ã®ã²ã¨ã¤ã®è¦å ã§ããããç¹ã«ãRaspbbery Piã¨ããã·ã³ã°ã«ãã¼ãã³ã³ãã¥ã¼ã¿ããç«ä»ãå½¹ã«ãªã£ããã¨ã¯ééãããã¾ãããã·ã³ã°ã«ãã¼ãã³ã³ãã¥ã¼ã¿ã¨ã¯ãããªã³ãåºæ¿ã®ä¸ã«ãPCã¨ãã¦æä½éã®ãã¼ããå®è£ ãããã®ã§ãã
ãã¾ããRaspbbery Piã¯ãã·ã³ã°ã«ãã¼ãã³ã³ãã¥ã¼ã¿ã®ãã¼ã ãå¼ãèµ·ããã¾ãããTessel 2ã®åã®ãã¼ã¸ã§ã³ã§ããTesselãããã®æµãã®ãªãã§èªçããã¯ã³ãã¼ããã¤ã³ã³ã§ãããªããã¯ã³ãã¼ããã¤ã³ã³ã¨ããè¨èã¯ãã·ã³ã°ã«ãã¼ãã³ã³ãã¥ã¼ã¿ãå«ãåºãæå³ã§ã使ããã¾ãããããã§ã¯ãPCã®ãããªæ±ç¨çãªOSãæè¼ãã¦ããªãå°åã®ã³ã³ãã¥ã¼ã¿ï¼ãã¤ã¯ãã³ã³ãã¥ã¼ã¿ï¼ã®æå³ã¨ãã¾ãã
ãæ¬é£è¼ã§ã¯ãã¯ã³ãã¼ããã¤ã³ã³Tessel 2ãç´¹ä»ãã¾ããTessel 2ã¯ãOpenWrtã¨ããçµã¿è¾¼ã¿ã·ã¹ãã ç¨Linuxãã£ã¹ããªãã¥ã¼ã·ã§ã³ä¸ã§åä½ããNode.jsã®JavaScriptå®è¡ç°å¢ããã£ã¦ãã¾ãï¼Tessel 2ããã¯ãã¾ã éçºéä¸ãªãããRustãPythonãå®è¡å¯è½ï¼ãã¾ããTessel 2ã¯ãæ¬ä½ã«USBãã¼ããWiFiãEthernetãå®è£ ããã¦ãããããã«æ¡å¼µç¨ã«2ã¤ã®ãã¼ããã¤ãã¦ãã¾ãããã®æ¡å¼µãã¼ãã«ã¯ãã»ã³ãµã¼ãªã©ã®å°ç¨ã¢ã¸ã¥ã¼ã«ãç¨æããã¦ãã¦ãããããåã«è£ çããã ãã§ããã¼ãã¦ã§ã¢ã¢ã¸ã¥ã¼ã«ãå¶å¾¡å¯è½ã§ããã¢ã¸ã¥ã¼ã«ã«ã¯ãå é度ãç°å¢ï¼é³ã»å ï¼ãæ°åï¼æ°æ¸©ã»æ¹¿åº¦ï¼ãªã©ã®ããã¾ãã¾ãªã»ã³ãµããããé»åå·¥ä½ã®ç¥èã¯ä¸è¦ã§ãï¼ãã¡ãããGPIOã使ã£ã¦å·¥ä½ãããã¨ãå¯è½ã§ãï¼ã
ããã³ãä»ãä¸è¦ã§ã»ã³ãµã¼ãæ±ããJavaScriptã§ããã°ã©ãã³ã°ã§ããããããã¼ãã¦ã§ã¢ã«é¢ãã¦è©³ãããªãWebç³»ã®æè¡è ã§ããTessel 2ã§ã¯ã»ã³ãµã¼ãå¶å¾¡ããIoTã·ã¹ãã ãæ§ç¯å¯è½ã§ãã
Tessel 2ã®è³¼å ¥
ãTessel 2ã®åãã¼ã¸ã§ã³ã®Tesselã¯ãã¹ã¤ãããµã¤ã¨ã³ã¹ã§è²©å£²ããã¦ãã¾ããããTessel 2ã¯ã¾ã å½å ã®è²©å£²ä¼ç¤¾ããã¯è³¼å ¥ã§ãã¾ããï¼å·çæç¹ï¼ã
ãTessel 2ã®å ¬å¼ãµã¤ãã«ã¯ãä¸å½ã¨ã¢ã¡ãªã«ã®é販ãµã¤ãã®ãªã³ã¯ãããã¾ãã®ã§ããã®é販ãµã¤ãããåäººè¼¸å ¥ã¨ããå½¢ã§è³¼å ¥ãã¾ãã
ããããã£ã¦ã¾ã Tessel 2ã¯ãããããæé©ãåãã¦ãã¾ããã®ã§ãå®ä½¿ç¨ã«ããã¦ã¯ã注æãå¿ è¦ã§ãã
éçºç°å¢ã®æ§ç¯
ãããã§ã¯ãã¾ãã¯éçºç°å¢ãæ§ç¯ãã¾ããããæ¬é£è¼ã§ã¯ãWindowsç°å¢ãæ³å®ãã¦ãã¾ãã
Node.jsã§ã®éçºç°å¢
ãåºæ¬çã«ã¯ãNode.jsã®éçºç°å¢ã¨åæ§ã§ãã³ãã³ãã©ã¤ã³ãå©ç¨ãã¦æä½ãã¾ãããªããéçºç°å¢ã¯ãè¤æ°ã®ãã¼ã«ã®çµã¿åããã§ãã®ã§ããã¾ãæ°ãããã¼ã¸ã§ã³ã使ãã¨åä½ããªãã±ã¼ã¹ãããããã§ããããã§ã¯å·çæç¹ã§ãæ£å¸¸ã«åä½ãããã¼ã¸ã§ã³ãã¤ã³ã¹ãã¼ã«ãããã¨ã«ãã¾ãã
ããªããNode.jsã§ã®éçºç°å¢ãã¤ã³ã¹ãã¼ã«æ¸ã¿ã§ããã°ãåºæ¬çã«ã¯ããã§ã®ä½æ¥ã¯ä¸è¦ã§ãã
Gitã®ã¤ã³ã¹ãã¼ã«
ããã¼ã¸ã§ã³ç®¡çã·ã¹ãã Gitã®ã¯ã©ã¤ã¢ã³ããå¿ è¦ã§ãã®ã§ãã¾ã ã¤ã³ã¹ãã¼ã«ãã¦ããªããã°ã æåã«Git for Windowsããããã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
ãã¤ã³ã¹ãã¼ã«ã®ãªãã·ã§ã³ã¯ãããã©ã«ãã®ã¾ã¾ã§ãã¾ãã¾ããã
Pythonã®ã¤ã³ã¹ãã¼ã«
ã次ã«ãPythonãã¤ã³ã¹ãã¼ã«ãã¾ããææ°ã¯ããã¼ã¸ã§ã³3ç³»ã§ãããTessel 2ã®éçºã§ã¯ãã¼ã¸ã§ã³2ç³»ãå©ç¨ãã¾ããæ¬è¨äºã§ã¯ããã¼ã¸ã§ã³2.7.12ãã¤ã³ã¹ãã¼ã«ãã¾ããããããã¤ã³ã¹ãã¼ã«ã¯ãããã©ã«ãè¨å®ã®ã¾ã¾ã§åé¡ããã¾ããã
ããã ãããã®ã¤ã³ã¹ãã¼ã©ã¯ãPATHã®è¨å®ã¾ã§ãã¦ããã¾ããã®ã§ãã¤ã³ã¹ãã¼ã«å¾ã«PATHã®è¨å®ãå¿ è¦ã§ããWindowsã®ã·ã¹ãã ã¡ãã¥ã¼ããããã·ã¹ãã ã®è©³ç´°è¨å®ãã¼ãç°å¢å¤æ°ããé¸ãã§ãpathã«ãã¤ã³ã¹ãã¼ã«å ãã©ã«ãï¼C:\Python27ï¼ã追å ãã¦ããã¾ãã
Node.jsã®ã¤ã³ã¹ãã¼ã«
ãããã¦Node.jsã®ã¤ã³ã¹ãã¼ã«ã§ããããã§ã¯ããã¼ã¸ã§ã³4.4.7ãé¸æãã¾ãããã¤ã³ã¹ãã¼ã«ãªãã·ã§ã³ã¯ããã¹ã¦ããã©ã«ãã§ãã¾ãã¾ããã
ã以ä¸ã®ãã¼ã«ãã¤ã³ã¹ãã¼ã«ã§ããããèµ·åã確èªãã¦ããã¾ããã³ãã³ãããã³ãããã次ã®ããã«å ¥åãã¦ããã¼ã¸ã§ã³ãåºåãã¦ã¿ã¾ãããã