单色灯 - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki

功能介绍

接收云端下发属性来控制灯的开关状态,并更新灯的状态至云端。

应用介绍

image.png | left | 827x366

  • 模组IO配置 单色灯的连接在GPIO 22管脚上,配置成输出模式 GPIO配置成输出模式, 默认配置成高阻
{
  "GPIO": [
    {
      "id": "monochrome_light",
      "port": 22,
      "dir": 0,
      "pull": 1
    }
  ]
}

LED三级管接线示意图: 长边接3.3VDC, 串接一个200欧姆的电阻,LED的输入电流需要小于20MA (5.0 VDC + 300Ω) 短边接GPIO 22

image.png | left | 680x540

云端控制

  • 控制LED灯状态

image.png | left | 827x305

  • 查看LED灯当前状态

image.png | left | 827x316

内存占用情况

  • JS符号表
# meminfo 
 [ 152.680]<W> main [handle_meminfo_cmd#227] : call handle_meminfo_cmd ...
 [ 152.680]<W> BoneEngine [handle_meminfo_cmd#228] : memory usage= 454 max=516

#
  • 系统内存
# dumpsys mm_info
......
------------------------- memory allocation statistic ------------------------------ 
     free     |     used     |     maxused
      119848  |      121496  |      131512

-----------------number of alloc times:-----------------
[2^06] bytes:  4561   |[2^07] bytes:   711   |[2^08] bytes:   268   |[2^09] bytes:   289   |
[2^10] bytes:    52   |[2^11] bytes:  3485   |[2^12] bytes:    12   |[2^13] bytes:     5   |
[2^14] bytes:     5   |[2^15] bytes:     0   |[2^16] bytes:     0   |[2^17] bytes:     0   |
[2^18] bytes:     0   |[2^19] bytes:     0   |[2^20] bytes:     0   |[2^21] bytes:     0   |
-----------------fix pool information:-----------------
     free     |     used     |     total
        4864  |        3328  |        8192

# 

⚠️ **GitHub.com Fallback** ⚠️