{"id":24969290,"url":"https://github.com/yianandcode/iot","last_synced_at":"2025-07-12T20:34:55.689Z","repository":{"id":85968864,"uuid":"68814908","full_name":"YianAndCode/IoT","owner":"YianAndCode","description":"My IoT toolbox","archived":false,"fork":false,"pushed_at":"2016-09-25T14:40:30.000Z","size":348,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T05:05:22.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YianAndCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-21T12:32:54.000Z","updated_at":"2016-12-26T03:26:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"e97c66be-9fab-4b5a-93f2-c505cb0ee298","html_url":"https://github.com/YianAndCode/IoT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YianAndCode/IoT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2FIoT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2FIoT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2FIoT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2FIoT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YianAndCode","download_url":"https://codeload.github.com/YianAndCode/IoT/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YianAndCode%2FIoT/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265049332,"owners_count":23703514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-02-03T14:37:05.993Z","updated_at":"2025-07-12T20:34:55.626Z","avatar_url":"https://github.com/YianAndCode.png","language":"C","readme":"# 我的 IoT 工具箱\n\n## 环境\n\n开发板： Raspberry Pi 2  \nGPIO 库：WiringPi\n\n## 准备\n\n### 安装 WiringPi ：  \n```bash\ngit clone git://git.drogon.net/wiringPi\n\ncd wiringPi\n./build\n```\n\n### Raspberry Pi 2 GPIO 图：\n\n![实物图](PI.jpg)  \n实物图\n\n![GPIO](GPIO.jpg)  \nGPIO\n\n### 查看 WiringPi 库对应的 GPIO 口引脚编号\n\n终端下执行\n```bash\ngpio readall\n```\n然后就会得到类似于下面的结果：\n```\n +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |\n |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |\n |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |\n |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | OUT  | TxD     | 15  | 14  |\n |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |\n |  17 |   0 | GPIO. 0 |  OUT | 0 | 11 || 12 | 0 | OUT  | GPIO. 1 | 1   | 18  |\n |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |\n |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |\n |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |\n |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |\n |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |\n |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |\n |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |\n |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |\n |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |\n |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |\n |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |\n |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |\n |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |\n |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+\n```\n其中 `Physical` 是指实际编号，`wPi` 列就是 WiringPi 库所用的编号，`BCM` 则是 `BCM2835 C Library` 所使用编号的","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyianandcode%2Fiot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyianandcode%2Fiot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyianandcode%2Fiot/lists"}