第二章 GoKit的板载硬件离线控制:RGB灯
本帖最后由 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控制函数
页:
[1]