{"id":15905155,"url":"https://github.com/huangcongqing/iot2","last_synced_at":"2026-03-18T17:13:38.213Z","repository":{"id":107569122,"uuid":"155509156","full_name":"HuangCongQing/IoT2","owner":"HuangCongQing","description":"物联网综合实验二（2018年秋  | 重庆邮电大学·物联网工程","archived":false,"fork":false,"pushed_at":"2019-10-17T19:34:17.000Z","size":5957,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T13:10:40.696Z","etag":null,"topics":["iot","iot-application","iot-device","iot-framework","iot-platform"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","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/HuangCongQing.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-31T06:24:20.000Z","updated_at":"2022-10-16T16:10:00.000Z","dependencies_parsed_at":"2023-06-08T12:30:46.717Z","dependency_job_id":null,"html_url":"https://github.com/HuangCongQing/IoT2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HuangCongQing/IoT2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuangCongQing%2FIoT2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuangCongQing%2FIoT2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuangCongQing%2FIoT2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuangCongQing%2FIoT2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HuangCongQing","download_url":"https://codeload.github.com/HuangCongQing/IoT2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuangCongQing%2FIoT2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:27:41.514Z","status":"ssl_error","status_checked_at":"2026-01-15T21:54:47.910Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["iot","iot-application","iot-device","iot-framework","iot-platform"],"created_at":"2024-10-06T13:00:53.967Z","updated_at":"2026-01-15T22:28:04.547Z","avatar_url":"https://github.com/HuangCongQing.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IoT2\n物联网综合实验二（2018年秋） | 重庆邮电大学·物联网工程\n\n**PLUS**\n* 波特率设置“19200”；\n* `delay_ms(10000);`延迟1万ms,就是延迟10s\n\n链接：https://pan.baidu.com/s/1HdEtRN52FQckb0MaRqsdFw \n提取码：2v2q \n复制这段内容后打开百度网盘手机App，操作更方便哦\n\n### 实验\n\n* 加热器控制实验\n\n* 二氧化碳传感器采集实验\n\n* 排风扇控制实验\n\n* 水泵控制实验\n\n```\n#include\u003cioCC2530.h\u003e //引入CC2530对应的头文件\n#include\u003cstring.h\u003e   //包含字符串处理函数声明\n#include\"sys_init.h\"\n#include\"uart.h\"\nvoid uart_test(void);\nuchar ch;\n\n/*水泵初始化*/\nvoid Pump_init(void)\n{\n  P0SEL \u0026=~0x02;  //配置P0_1为普通IO\n  P0DIR |= 0x02; //配置P0_1为 输出\n  P0_1  =  0;   //水泵默认关闭\n}\n\n/*串口接收与发送函数*/\nvoid uart_test(void)\n{\n  ch = Uart_Recv_char(); //将串口接收与发送函数放在一起,便于调用，\n                        //  此实验为单独调用其内部函数\n  Uart_Send_char(ch);\n}\n\n\nvoid main(void)\n{\n  Pump_init(); //水泵硬件初始化\n  xtal_init();//系统时钟初始化       \n  uart0_init(0x00, 0x00);            //初始化串口：无奇偶校验，停止位为1位\n  Uart_Send_String(\"串口控制水泵实验\\r\\n\");\n  P0_6 = 0;                  //设置为接收模式(485控制端)\n  while(1)\n  {\n     ch = Uart_Recv_char(); //串口接收字节函数\n    if (ch == 1)\n    {\n     \t P0_1= 1;           //串口接收到“01”打开水泵\n    }\n    if(ch == 0)       \n    {                   //串口接收到“00”关闭水泵\n    \t  P0_1 = 0;\n    }\n    P0_6 = 1;         //485控制端设置为高电平，485串口设置为发送模式\n    Uart_Send_char(ch);\n    P0_6 = 0;        //485控制端设置为低电平，串口设置为接收模式，再次接收串口数据\n\n   }\n}\n    \n    \n```\n\n### 软件\n\n### 硬件\n\n\n\n### License\n\nCopyright (c) [ChungKing](https://github.com/HuangCongQing/). All rights reserved.\n\nLicensed under the [MIT](./LICENSE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangcongqing%2Fiot2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuangcongqing%2Fiot2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangcongqing%2Fiot2/lists"}