当前位置: 首页 > news >正文

给宝宝做衣服网站sem算网站设计吗

给宝宝做衣服网站,sem算网站设计吗,外贸平台收费标准,下35cm本篇介绍使用轮询方式读取gpio状态来判断按键状态。 原理图如下 GPIO API API名称 说明 hi_u32 hi_gpio_init(hi_void); GPIO模块初始化 hi_u32 hi_io_set_pull(hi_io_name id, hi_io_pull val); 设置某个IO上下拉功能。 hi_u32 hi_gpio_set_dir(hi_gpio_idx id, hi_gpi…本篇介绍使用轮询方式读取gpio状态来判断按键状态。 原理图如下 GPIO API API名称 说明 hi_u32 hi_gpio_init(hi_void); GPIO模块初始化 hi_u32 hi_io_set_pull(hi_io_name id, hi_io_pull val); 设置某个IO上下拉功能。 hi_u32 hi_gpio_set_dir(hi_gpio_idx id, hi_gpio_dir dir); 设置GPIO引脚方向id参数用于指定引脚dir参数用于指定输入或输出 hi_u32 hi_gpio_get_input_val(hi_gpio_idx id, hi_gpio_value* val); 获取某个IO管脚输入电平状态 修改D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\BUILD.gn文件 # Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import(//build/lite/config/component/lite_component.gni)lite_component(demo) {features [#base_00_helloworld:base_helloworld_example,#base_01_led:base_led_example,base_02_loopkey:base_loopkey_example,] } 创建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\base_02_loopkey文件夹 文件夹中创建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\base_02_loopkey\base_loopkey_example.c文件D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\base_02_loopkey\BUILD.gn文件 # Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. static_library(base_loopkey_example) {sources [base_loopkey_example.c,]include_dirs [//utils/native/lite/include,//kernel/liteos_m/kal/cmsis,//base/iot_hardware/peripheral/interfaces/kits,//vendor/hqyj/fs_hi3861/common/bsp/include] } /** Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd* Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/#include stdio.h #include unistd.h#include cmsis_os2.h #include hi_gpio.h #include hi_io.h #include ohos_init.h#define KEY1 HI_IO_NAME_GPIO_6 // 对应按键key1 #define KEY2 HI_IO_NAME_GPIO_5 // 对应按键key2osThreadId_t Task1_ID 0; // 任务1 ID hi_gpio_value val1, val1_last, val2, val2_last; // GPIO的状态值 #define TASK_STACK_SIZE 1024 #define TASK_DELAY_TIME (200 * 1000)/*** description: 任务1* param {*}* return {*}*/ void Task1(void) {printf(enter Task 1.......\r\n);hi_gpio_init(); // GPIO初始化hi_io_set_pull(KEY1, HI_IO_PULL_UP); // 设置GPIO上拉hi_io_set_func(KEY1, HI_IO_FUNC_GPIO_6_GPIO); // 设置IO16为GPIO功能hi_gpio_set_dir(KEY1, HI_GPIO_DIR_IN); // 设置GPIO为输入模式hi_io_set_pull(KEY2, HI_IO_PULL_UP); // 设置GPIO上拉hi_io_set_func(KEY2, HI_IO_FUNC_GPIO_5_GPIO); // 设置IO15为GPIO功能hi_gpio_set_dir(KEY2, HI_GPIO_DIR_IN); // 设置GPIO为输入模式while (1) {hi_gpio_get_input_val(KEY1, val1); // 获取GPIO引脚的状态if (val1 ! val1_last) {// 当GPIO状态改变的时候, 打印输出printf(key1Value: %s\r\n, val1 ? HI_GPIO_VALUE_1 : HI_GPIO_VALUE_0);val1_last val1;}hi_gpio_get_input_val(KEY2, val2); // 获取GPIO引脚的状态if (val2 ! val2_last) {// 当GPIO状态改变的时候, 打印输出printf(key2Value: %s\r\n, val2 ? HI_GPIO_VALUE_1 : HI_GPIO_VALUE_0);val2_last val2;}// 200ms一检测usleep(TASK_DELAY_TIME); // 200ms sleep} }/*** description: 初始化并创建任务* param {*}* return {*}*/ static void base_key_demo(void) {printf([demo] Enter base_key_demo()!\r\n);osThreadAttr_t taskOptions;taskOptions.name Task1; // 任务的名字taskOptions.attr_bits 0; // 属性位taskOptions.cb_mem NULL; // 堆空间地址taskOptions.cb_size 0; // 堆空间大小taskOptions.stack_mem NULL; // 栈空间地址taskOptions.stack_size TASK_STACK_SIZE; // 栈空间大小 单位:字节taskOptions.priority osPriorityNormal; // 任务的优先级:wqTask1_ID osThreadNew((osThreadFunc_t)Task1, NULL, taskOptions); // 创建任务1if (Task1_ID ! NULL) {printf(ID %d, Create Task1_ID is OK!\r\n, Task1_ID);} } SYS_RUN(base_key_demo);目录结构 │ config.json │ ├─common │ └─bsp │ ├─include │ └─src ├─demo │ │ BUILD.gn │ │ │ ├─base_00_helloworld │ │ base_helloworld_example.c │ │ BUILD.gn │ │ │ ├─base_01_led │ │ base_led_example.c │ │ BUILD.gn │ │ │ └─base_02_loopkey │ base_loopkey_example.c │ BUILD.gn │ └─doc│ HarmonyOS开发板实验指导书 v2.1.pdf│ 华清远见 FS_Hi3861开发指导.md│ 华清远见 FS_Hi3861新手入门手册.md│├─board│ FS-Hi3861-V4.2.pdf│ FS-Hi3861QDB-V3.2.pdf│ hi-12f_kit_v1.1.0A7E6BCB9%A6-20211025.pdf│ hi-12f_v1.1.2-A7E6BCB9%A6-20211202.pdf│ nodemcu-hi-07s_12f-kit_v1.1-20210913.pdf│ RTplay2.01_2024-06-14.pdf│└─figures 使用build编译成功后使用upload进行烧录。 运行效果如下按下按键会有对应按键状态输出。
http://www.zqtcl.cn/news/344137/

相关文章:

  • 深圳大学网站建设中美军事最新消息
  • gta5可用手机网站大全佛山网站建设服务
  • 智能建站软件哪个好智慧城市建设评价网站
  • 做网站用什么配资电脑织梦做的网站织梦修改网页模板
  • 手机网站制作吧网店营销策略
  • 管理员修改网站的参数会对网站的搜效果产生什么影响?网站建设新闻+常识
  • WordPress主题没有删除网站优化 工具
  • 建设外贸商城网站制作外国网站域名在哪查
  • 青浦练塘网站建设关键词优化的策略有哪些
  • 做网站链接怎么弄上海万户网络技术有限公司
  • 嵌入字体的网站网站结构和布局区别
  • 莆田网站建设五维网络有限公司零基础网站开发要学多久
  • 重庆官方网站查询系统2020最近的新闻大事10条
  • 中国网站建设公司排行榜成都彩票网站建设
  • 网站域名解析失败个人推广网站
  • 东莞网站建设网络公司排名卓业网站建设
  • 建立自己的网站平台的好处高校英文网站建设
  • 大力推进网站集约化建设兰州优秀网站推广
  • 手机wap网站怎样从微信公众号打开辽宁省住房和城乡建设厅网站上不去
  • 网站建设备案 优帮云四川建设设计公司网站
  • dede网站搬家 空间转移的方法网站建设多少钱一个平台
  • 山东济南网站开发互联网创业项目哪家好平台
  • 公司网站建设文案济南网站定制策划
  • 怎么做网站例如京东小红书推广引流
  • 游戏网站建设策划书企业vi包含哪些内容
  • 教育视频网站开发网站响应时间长
  • 在哪些网站做收录比较快张家港江阴网站设计
  • 商业网站最佳域名贵州网站建设
  • 毕业设计做网站的步骤网络推广关键词优化公司
  • 悠悠我心的个人网站怎么做怎么开网站平台