本章目的是把开发板上的3个三色LED灯点亮。
1.硬件连接
先看下硬件的LED接线如下:


由上图可知:
IO_12:LED_G
IO_13:LED_R
IO_14:LED_B
IO输出低电平"0",LED点亮,IO输出高电平"1",LED熄灭。
2.软件编写
在 kendryte-standalone-sdk/src 目录下创建gpio_led文件夹,如下:

main.c 代码如下:
/* Copyright 2018 Canaan Inc.
*
* 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
Kendryte开发板上三色LED灯控制教程:硬件连接与软件编程,

最低0.47元/天 解锁文章
2357

被折叠的 条评论
为什么被折叠?



