当前位置:网站首页>涂鸦幻彩产品开发包如何使用
涂鸦幻彩产品开发包如何使用
2022-07-26 03:38:00 【三明治开发社区】
1 产品开发包介绍
专注于幻彩照明能力的输出,并拥有全彩的核心调光调色能力。
让幻彩行业开发者进一步降低开发成本,提供多种示例程序,
提升产品的开发效率并可以做出行业差异化的产品。
具有低成本、提效率、可拓展的特点。
2 产品开发包开发方法
可以参考涂鸦Wi-Fi模组SDK二次开发的教程
开发包同时配备各核心功能demo示例可参考,如:本地音乐律动
名词解释
| 名词 | 详细说明 | 备注 |
|---|---|---|
| 音乐律动 | 根据音乐的旋律有节奏的点亮灯带 | |
| 频谱 | 在律动时,根据音量大小改变点亮灯珠的数量。放大变化幅度,较低的音量, 灯带也能亮起较多的点数 | |
| 能量 | 没有声音时,灯带全灭。有声音时,从中间向两边延伸变化 | |
| 摇滚 | 有声音时直接亮起来无渐变,声音持续高昂时快速闪烁 | |
| 爵士 | 首次触发时,以渐变的方式亮起来,音乐节拍快的时候,跳变变化同时在中高亮度和最大亮度之间呼吸一次,检测到节拍时立刻刷新颜色跳变 | |
| 经典 | 有声音时跳变切换颜色,没有声音时灯常亮,停留在最后一个颜色 |
基本功能
1、提供音乐模式管理、音乐律动控制等功能
2、提供本地音乐律动功能,支持流水、频谱、能量、摇滚、爵士、经典六种模式
组件依赖
| sdk组件依赖 | 说明 |
|---|---|
| tuya_hal_mutex.h | 锁 |
| tuya_hal_semaphore.h | 信号量 |
| tuya_hal_thread.h | 线程 |
| mem_pool.h | 内存池 |
| uni_log.h | 日志管理 |
| sys_timer.h | 软件定时器 |
| uni_time.h | 获取系统时间 |
| tuya_hal_system.h | 系统相关接口 |
| 应用组件依赖 | 说明 |
|---|---|
| tdl_sound_sample | 声音采样 |
| tdl_leds_pixel_manage | 幻彩像素点驱动 |
| tbs_light_tools | 照明工具函数库 |
| tfm_light_control | 照明基础服务(色彩渐变服务 用于爵士) |
资源依赖
| 资源 | 大小 | 说明 |
|---|---|---|
| 初始化服务并添加六种模式占用内存 | 约3.2k | 渐变任务不在计算之内 |
接口列表说明
- 音乐律动管理、控制操作接口,详细使用说明参考
tbl_leds_music.h
| 接口 | 说明 |
|---|---|
| OPERATE_RET tbl_leds_music_init(CHAR_T *sound_dev); | 本地音乐律动初始化 |
| OPERATE_RET tbl_leds_music_add_mode(UCHAR_T mode_id, VOID_T *led_dev, MUSIC_CFG_T *cfg, MUSIC_MODE_FUNCTION func); | 添加音乐律动模式 |
| OPERATE_RET tbl_leds_music_del_mode(UCHAR_T mode_id); | 删除音乐律动模式 |
| OPERATE_RET tbl_leds_music_mode_config(UCHAR_T mode_id, MUSIC_MODE_CMD_E cmd, VOID_T *arg); | 配置音乐律动模式 |
| OPERATE_RET tbl_leds_music_ctrl(UCHAR_T mode_id, BOOL_T on_off); | 音乐律动控制(开关) |
- 音乐律动模式接口,详细使用说明参考
tbl_leds_pixel_music_mode.h
| 接口 | 说明 |
|---|---|
| OPERATE_RET tbl_pixel_music_add_water(UCHAR_T mode_id, PIXEL_HANDLE_T pxiel_dev); | 添加流水模式 |
| OPERATE_RET tbl_pixel_music_add_frequency(UCHAR_T mode_id, PIXEL_HANDLE_T pxiel_dev); | 添加频谱模式 |
| OPERATE_RET tbl_pixel_music_add_power(UCHAR_T mode_id, PIXEL_HANDLE_T pxiel_dev); | 添加能量模式 |
| OPERATE_RET tbl_pixel_music_add_rock(UCHAR_T mode_id, PIXEL_HANDLE_T pxiel_dev); | 添加摇滚模式 |
| OPERATE_RET tbl_pixel_music_add_jazz(UCHAR_T mode_id, PIXEL_HANDLE_T pxiel_dev); | 添加爵士模式 |
| OPERATE_RET tbl_pixel_music_add_classic(UCHAR_T mode_id, PIXEL_HANDLE_T pxiel_dev); | 添加经典模式 |
使用说明
#define SOUND_DEVICE_NAME "my_sound"
#define PIXEL_DEVICE_NAME "my_leds_pixel"
PIXEL_HANDLE_T pixel_handle;
void tuya_sound_sample_device_demo(void)
{
int op_ret = 0;
op_ret = tdd_sound_adc_register(SOUND_DEVICE_NAME, TUYA_ADC2, 4096);
if(op_ret != 0) {
PR_ERR("tdd_sound_adc_register err:%d", op_ret);
return;
}
PR_NOTICE("tdd_sound_adc_register succ");
op_ret = tdd_ws2812_driver_register(PIXEL_DEVICE_NAME);
if(op_ret != 0) {
PR_ERR("tdd_ws2812_driver_register err:%d", op_ret);
return;
}
op_ret = tdl_pixel_dev_find(PIXEL_DEVICE_NAME, &pixel_handle);
if(op_ret != 0) {
PR_ERR("tdl_pixel_dev_find err:%d", op_ret);
return;
}
PIXEL_DEV_CONFIG_T pixel_cfg = {
.pixel_num = 100,
.tx_inform_cb = NULL,
};
op_ret = tdl_pixel_dev_open(pixel_handle, &pixel_cfg);
if(op_ret != 0) {
PR_ERR("tdl_pixel_dev_find err:%d", op_ret);
return;
}
/* 爵士模式用到渐变功能 */
op_ret = tfm_color_shade_service_init(TUYA_TIMER2, TFM_LIGHT_TIMER_PERIOD_US);
if(op_ret != 0) {
PR_ERR("tfm_color_shade_service_init err:%d", op_ret);
return;
}
tbl_leds_music_init(SOUND_DEVICE_NAME);
tbl_pixel_music_add_water(0, pixel_handle);
tbl_pixel_music_add_frequency(1, pixel_handle);
tbl_pixel_music_add_power(2, pixel_handle);
tbl_pixel_music_add_rock(3, pixel_handle);
tbl_pixel_music_add_jazz(4, pixel_handle);
tbl_pixel_music_add_classic(5, pixel_handle);
tbl_leds_music_ctrl(0, 1);
return;
}
如何获取产品开发包
请直接站内私信联系
边栏推荐
- 基本折线图:最直观呈现数据的趋势和变化
- Sersync/lsync real-time synchronization
- 9-20v input peak charging current 3A dual lithium switch type charging chip sc7102
- [create interactive dice roller application]
- 阿里二面:千万级数据量的表,快速查询如何进行?
- PHP connects to MySQL database, and database connects to static tool classes to simplify the connection.
- MPLS basic experiment configuration
- Performance comparison of ext4, NTFS, XFS, Btrfs, ZFS, f2fs and ReiserFS
- 6年从零开始的自动化测试之路,开发转测试我不后悔...
- 2022-07-21 study notes of group 4 self-cultivation class (every day)
猜你喜欢
![[STL]优先级队列priority_queue](/img/79/d13913cbb9d98f936a9501633b38bf.png)
[STL]优先级队列priority_queue

Hurry in!!! Write a number guessing game with dozens of lines of code based on the basic knowledge of C language

大厂面试都面试些啥,看了不亏(一)

研发了 5 年的时序数据库,到底要解决什么问题?

Illustration leetcode - 5. Longest palindrome substring (difficulty: medium)

Uncaught TypeError: $(...).onmouseenter is not a function js错误,解决办法:

waf详解

ACM mm 2022 | end to end multi granularity comparative learning for video text retrieval

MPLS basic experiment configuration

Completion report of communication software development and Application
随机推荐
els 注册窗口类、创建窗口类、显示窗口
How Lora wireless gateway can quickly realize end-to-cloud transmission
Hurry in!!! Write a number guessing game with dozens of lines of code based on the basic knowledge of C language
A 4W word redis interview tutorial
Hcip day 8 notes sorting (OSPF routing control, Appendix E, anti ring, shortest path calculation, republication))
Easyexcel sets row hiding to solve the problem of sethidden (true) invalidation
MPLS basic experiment configuration
让百度收录,爬虫自己网站
Navicat connects to MySQL database on Cloud Server
【创建交互式 Dice Roller 应用】
2020 AF-RCNN: An anchor-free convolutional neural network for multi-categoriesagricultural pest det
线性回归原理推导
使用anaconda配置gpu版本的tensorflow(30系列以下显卡)
File upload error: current request is not a multipart request
IDEA2020.3.1不能打开(双击不能打开),但可以通过idea.bat打开。
2020 AF-RCNN: An anchor-free convolutional neural network for multi-categoriesagricultural pest det
网络模型及协议
LoRa和NB-IOT可用用在哪些地方
Apply for SSL certificate, configure SSL certificate for domain name, and deploy server; Download and installation of SSL certificate
Summary of basic knowledge of C language pointer (I)