volume-系统音量

仅带喇叭的型号(例如X3、X5系列)支持

注意

设置volume时,会判断当前值与flash中保存的值是否一致,如果一致则不写入,如果不一致,则会写入flash中保存,因此修改volume值会消耗flash寿命

volume-示例1

1 //设置音量60%
2 volume=60
../_images/volume_1.jpg

volume-示例2

1 //设置音量0%
2 volume=0
../_images/volume_2.jpg

volume-示例3

1 //设置音量100%
2 volume=100
../_images/volume_3.jpg

volume-示例4

1 //每次触发时音量+1%
2 volume++
3
4 //每次触发时音量+10%
5 volume+=10
../_images/volume_4.jpg ../_images/volume_5.jpg

volume-示例5

1 //每次触发时音量-1%
2 volume--
3
4 //每次触发时音量-10%
5 volume-=10
../_images/volume_6.jpg ../_images/volume_7.jpg

注意

仅x5 x3系列才支持,音量设置范围为0-100,每次设置会自动保存,断电后再开机依然有效。

音量设置过大导致供电不足可能会导致黑屏、重启等问题,此时应增大供电电流

参考

串口屏开机时死机/不断的闪烁/不断重启

外部供电接法

c语言示例:单片机通过串口控制串口屏音量

1 //音量设置为100%
2 printf("volume=100\xff\xff\xff");

volume-相关链接

play-音频播放