{"id":19027964,"url":"https://github.com/kennytian/learning-iot","last_synced_at":"2026-02-23T01:06:35.696Z","repository":{"id":30280231,"uuid":"122730349","full_name":"Kennytian/learning-iot","owner":"Kennytian","description":"用 JavaScript 切入机器人和物联网","archived":false,"fork":false,"pushed_at":"2025-03-29T03:29:43.000Z","size":1189,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T01:13:33.743Z","etag":null,"topics":["arduino","iot","javascript","johnny-five","robot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kennytian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-24T10:29:33.000Z","updated_at":"2025-03-29T03:29:42.000Z","dependencies_parsed_at":"2024-06-16T12:26:45.737Z","dependency_job_id":"1bcd669d-7bb4-4e09-afe9-608d7c3aef7f","html_url":"https://github.com/Kennytian/learning-iot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kennytian/learning-iot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Flearning-iot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Flearning-iot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Flearning-iot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Flearning-iot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kennytian","download_url":"https://codeload.github.com/Kennytian/learning-iot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Flearning-iot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29734248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","iot","javascript","johnny-five","robot"],"created_at":"2024-11-08T21:09:33.677Z","updated_at":"2026-02-23T01:06:35.647Z","avatar_url":"https://github.com/Kennytian.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 机器人爱 JavaScript\n\n[机器人爱 JavaScript 系列一](https://github.com/Kennytian/learning-iot/blob/master/docs/doc1.md)\n\n[机器人爱 JavaScript 系列二](https://github.com/Kennytian/learning-iot/blob/master/docs/doc2.md)\n\n### 配置项目\n\n1.  git clone https://github.com/Kennytian/learning-iot.git\n2.  cd learning-iot \u0026 yarn\n3.  配置`WebStorm + nodemon`，在`Node parameters`里加入：`/usr/local/bin/nodemon --exec /usr/local/bin/node`\n\n### 采购：\n\n1.  Arduino UNO 开发板。刚开始学习只需买一块开发板即可，会送一根线，板载有 led 灯，淘宝一般在 30 块钱左右。\n2.  Arduino 电子元件。随着后期深入学习，就自然明白需要什么元件，再买不迟。\n\n### 环境：\n\n1.  Mac、Windows、Linux 电脑均可（以后我以 Mac 电脑为开发环境）。\n2.  安装 Node 4.3.0 及以上版本，建议安装 LTS 版，下载地址 https://nodejs.org/en/download/ 。\n3.  安装 Arduino 相应驱动，并重启电脑。具体驱动请自行搜索开发板型号+当前操作系统，如：`ch340g mac`。 如果你买的是`Arduino UNO R3(CH340G)`开发板，就下载\n    http://www.wch.cn/download/CH341SER_MAC_ZIP.html 。\n4.  安装 Arduino IDE 开发环境，下载地址：https://www.arduino.cc/en/main/software\n\n### 开发板：\n\n1.  将 USB 数据线把电脑与开发板连接后，正常情况下你会在 Arduino IDE 上看到你开发板的端口，如图：\n\n    ![arduino_port](https://raw.githubusercontent.com/Kennytian/learning-iot/master/assets/arduino_port.jpg)\n\n    你开发板的端口很有可能与图中的端口不一样，但没有关系，只要识别出来就行。一般是：'/dev/cu.xxxusbxxx' 字样的标识。\n\n2.  打开 Arduino IDE, 选择: File \u003e Examples \u003e Firmata \u003e StandardFirmataPlus，如图：\n\n    ![standard_firemata_plus](https://raw.githubusercontent.com/Kennytian/learning-iot/master/assets/standard_firemata_plus.jpg)\n\n3.  在 Arduino IDE 界面点击 \"上传\" 按钮，如图：\n\n    ![upload_firemata](https://raw.githubusercontent.com/Kennytian/learning-iot/master/assets/upload_firemata.jpg)\n\n### 第一个程序\n\n1.  新建一个目录，比如：firstIoT，在命令行下进入该目录，执行：`npm install johnny-five`。\n2.  在 firstIot 里新建一个文件 `led-blink.js`，输入如下代码：\n\n```javascript\nconst { Board, Led } = require('johnny-five');\nnew Board().on('ready', function() {\n  var led = new Led(13);\n  led.blink(500);\n});\n```\n\n3.  在该目录下执行 `node led-blink.js`，如果程序不出错，就会出现下面的一闪一闪亮晶晶\n\n    ![led_blink](https://raw.githubusercontent.com/Kennytian/learning-iot/master/assets/led_blink.gif)\n\n----------------------------------推广分隔线----------------------------------\n\n欢迎 QQ 群加入交流 [700434239](http://shang.qq.com/wpa/qunwpa?idkey=11cd472ee62461eed296856bfe97e15e02fc551c4ff476ec4eba16e6a9c27000)\n\n![QQ群](https://raw.githubusercontent.com/Kennytian/learning-iot/master/assets/qq_group_qrcode.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennytian%2Flearning-iot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennytian%2Flearning-iot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennytian%2Flearning-iot/lists"}