【祖传点灯】安信可Ai-M61-32S + 点灯

[复制链接]
查看1237 | 回复7 | 2024-5-5 18:13:17 | 显示全部楼层 |阅读模式

本帖最后由 物联网 于 2024-5-5 18:16 编辑

点灯

环境搭建

安装依赖

sudo apt-get install make gcc vim cmake git ninja-build -y

image.png

克隆SDK

git clone -b master https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git

image.png

下载安信可SDK

修改.gitmodules 文件,把里面github 改成 gitee 我这里访问不到github

image.png

git submodule init 
git submodule update 
cd aithinker_Ai-M6X_SDK/

image.png

. install.sh 

image.png

.  export.sh

image.png

切换的 此目录

aithinker_Ai-M6X_SDK/examples/helloworld

修改main.c 文件

#include "bflb_mtimer.h"
#include "bflb_gpio.h"
#include "board.h"


struct bflb_device_s *gpio;
int main(void)
{
    board_init();
    gpio = bflb_device_get_by_name("gpio");

    /*初始化RGB灯,IO15,对应蓝灯*/
    bflb_gpio_init(gpio, GPIO_PIN_15, GPIO_OUTPUT | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_0);
    while(1)
    {
        bflb_gpio_set(gpio, GPIO_PIN_15);//将pin0设置为高电平
        bflb_mtimer_delay_ms(2000);//延迟2000毫秒,也就是2秒
        bflb_gpio_reset(gpio, GPIO_PIN_15);
        bflb_mtimer_delay_ms(2000);//延迟2000毫秒,也就是2秒
    }

}

点灯完成

b2fa0a653a498e7c645f461fa472064.jpg

回复

使用道具 举报

lazy | 2024-5-5 21:44:35 | 显示全部楼层
真棒
回复

使用道具 举报

1055173307 | 2024-5-19 11:46:59 | 显示全部楼层
回复

使用道具 举报

sansui | 2024-5-24 14:23:56 | 显示全部楼层
赞一下
回复

使用道具 举报

7788 | 2024-5-24 14:54:04 | 显示全部楼层
点灯成功
回复

使用道具 举报

timo | 2024-6-6 14:33:44 | 显示全部楼层
入坑了
回复

使用道具 举报

noonezero | 2024-6-21 08:20:45 | 显示全部楼层
不错
回复

使用道具 举报

楚华 | 2024-7-7 09:23:56 | 显示全部楼层
恭喜
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则