收藏官网首页
查看: 7617|回复: 0

第二章 GoKit的板载硬件离线控制:RGB灯

14

主题

108

帖子

598

积分

超级版主

Rank: 8Rank: 8

积分
598
跳转到指定楼层
楼主
发表于 2016-1-4 12:12:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
汉枫LPB120模块
本帖最后由 Beam. 于 2016-1-4 15:00 编辑

第二章 gokit的板载硬件离线控制:RGB灯
智能宠物屋 GoKit

arduino程序:

File Name:GoKit.cpp
Path:GoKit_2_MCU_Arduino-master\GoKit_2_MCU_Arduino\GoKit.cpp
DownLoad:https://git.oschina.net/dantang/GoKit_2_MCU_Arduino



void gokit_setColorRGB(byte red, byte green, byte blue)
{
       leds.setColorRGB(0, red, green, blue);
       //RGB三原色色值设置
}

//RGB颜色设置函数


STM32程序:

File Name:hal_rgb_led.c
Path:GoKit_2_MCU_STM-master\GoKit_2_MCU_STM\User\Hal_key\hal_rgb_led.c
DownLoad:https://git.oschina.net/dantang/GoKit_2_MCU_STM


void LED_RGB_Control(uint8_t R, uint8_t G, uint8_t B)
{
        Send32Zero();
        DataDealWithAndSend(R, G, B);          // display red
        DataDealWithAndSend(R, G, B);          // display red
        //printf("LED_R = %d LED_G = %d LED_B = %d",R,G,B);
}

//RGB控制函数
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

加入Q群 返回顶部

版权与免责声明 © 2006-2024 Gizwits IoT Technology Co., Ltd. ( 粤ICP备11090211号 )

快速回复 返回顶部 返回列表