利用鸿蒙套件进行简单的物联网模块(雏形)代码:staticvoidOnButtonPressedisr(chararg){(void)arg;printf("[HelloWorld]OnButtonPressed()\n");BtnPressed1;BtnPressedidx++;BtnPressedidx%4;GpioRegisterIsrFunc(WIFIIOTIONAMEGPIO8,WIFIIOTINTTYPEEDGE,WIFIIOTGPIOEDGERISELEVELHIGH,OnButtonReleasedisr,NULL);}staticvoidOnButtonReleasedisr(chararg){(void)arg;printf("[HelloWorld]OnButtonReleased()\n");BtnPressed0...
2021-01-08 19:08:50 1.0w浏览 2点赞 0回复 1收藏
在大概了解鸿蒙系统后和学习完编译环境搭建,于是我做了一个小小的实验,利用Hi3861GPIO操作完成点灯和按键实验先看最简单得LED灯闪烁操作源码结构如下:Helloworld.c文件内容:include<stdio.h>include<unistd.h>include"ohosinit.h"include"cmsisos2.h"include"wifiiotgpio.h"include"wifiiotgpioex.h"include"wifiiotpwm.h"staticWifiIotIoNameLightGPIO[]{WIFIIOTIONAMEGPIO10,WIFIIOTIONAMEGPIO11,WIFIIOTIONAMEGPIO12};st...
2020-12-24 19:47:35 1.3w浏览 2点赞 2回复 0收藏