mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
Merge branch 'master' of https://github.com/m5stack/m5-docs
This commit is contained in:
+858
-18
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
# Power
|
||||
|
||||
* Power related functions depend on the IP5306 chip. Please refer to the data sheet [IP5306] (https://github.com/m5stack/M5-Schematic/blob/master/Core/IIC_IP5306_REG_V1.4.pdf) as required.
|
||||
*Power related functions depend on the IP5306 chip. Please refer to the data sheet [IP5306](https://github.com/m5stack/M5-Schematic/blob/master/Core/IIC_IP5306_REG_V1.4.pdf) as required.*
|
||||
|
||||
* The older M5STACK hardware does not support communication with IP5306 chip. When using functions, also consider supporting out of control cases. *
|
||||
|
||||
|
||||
+66
-3
@@ -1,6 +1,43 @@
|
||||
# Speaker
|
||||
|
||||
### tone
|
||||
## begin()
|
||||
|
||||
**Description:**
|
||||
|
||||
Initialize the speaker.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>begin();</mark>
|
||||
|
||||
**Function argument:**
|
||||
|
||||
None
|
||||
|
||||
**Function return value:**
|
||||
|
||||
None
|
||||
|
||||
## end()
|
||||
|
||||
**Description:**
|
||||
|
||||
Mute the speakers and stop the output.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>end();</mark>
|
||||
|
||||
**Function argument:**
|
||||
|
||||
None
|
||||
|
||||
**Function return value:**
|
||||
|
||||
None
|
||||
|
||||
|
||||
## tone()
|
||||
|
||||
**Syntax:**
|
||||
|
||||
@@ -9,7 +46,7 @@
|
||||
**Description: Set the pitch of speaker.**
|
||||
|
||||
| Param | Description | type |
|
||||
| --- | --- | -- |
|
||||
| --- | --- | --- |
|
||||
| freq | frequency | uint16_t |
|
||||
| duration | duration (unit: millisecond) | uint16_t |
|
||||
|
||||
@@ -21,4 +58,30 @@ void setup() {
|
||||
M5.begin();
|
||||
M5.Speaker.tone(900, 1000);
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
## setBeep()
|
||||
|
||||
**Description:**
|
||||
|
||||
Set the beep sound.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
<mark>setBeep(uint16_t freq, uint16_t duration);</mark>
|
||||
|
||||
| Argument | Description | Type |
|
||||
| --- | --- | --- |
|
||||
| freq | pitch (frequency Hz) | uint16_t |
|
||||
| duration | beep time (ms), optional. | uint16_t |
|
||||
|
||||
**Example of use:**
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
M5.Speaker.setBeep(900, 1000);
|
||||
}
|
||||
```
|
||||
|
||||
+847
-6
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
# Power
|
||||
|
||||
*電源関連の機能はIP5306チップに依存しています。必要に応じてデータシート[IP5306](https://github.com/m5stack/M5-Schematic/blob/master/Core/IIC_IP5306_REG_V1.4.pdf)を参照してください*
|
||||
*電源関連の機能はIP5306チップに依存しています。必要に応じてデータシート[IP5306](https://github.com/m5stack/M5-Schematic/blob/master/Core/IIC_IP5306_REG_V1.4.pdf)を参照してください*
|
||||
|
||||
*古いM5STACKハードウェアの場合、IP5306チップが通信未対応です。機能を使う場合は制御できないケースも考慮してください。*
|
||||
|
||||
|
||||
+63
-1
@@ -1,5 +1,41 @@
|
||||
# スピーカー
|
||||
|
||||
## begin()
|
||||
|
||||
**機能:**
|
||||
|
||||
スピーカーを初期化します。
|
||||
|
||||
**構文:**
|
||||
|
||||
<mark>begin();</mark>
|
||||
|
||||
**引数:**
|
||||
|
||||
なし
|
||||
|
||||
**戻り値:**
|
||||
|
||||
なし
|
||||
|
||||
## end()
|
||||
|
||||
**機能:**
|
||||
|
||||
スピーカーをミュートし、出力を終了します。
|
||||
|
||||
**構文:**
|
||||
|
||||
<mark>end();</mark>
|
||||
|
||||
**引数:**
|
||||
|
||||
なし
|
||||
|
||||
**戻り値:**
|
||||
|
||||
なし
|
||||
|
||||
## tone()
|
||||
|
||||
**機能:**
|
||||
@@ -11,7 +47,7 @@
|
||||
<mark>tone(uint16_t freq, [uint32_t duration]);</mark>
|
||||
|
||||
| 引数 | 説明 | 型 |
|
||||
| --- | --- | -- |
|
||||
| --- | --- | --- |
|
||||
| freq | 音の高さ(周波数Hz) | uint16_t |
|
||||
| duration | 鳴動時間 (ms)、 省略可能。 | uint16_t |
|
||||
|
||||
@@ -26,6 +62,32 @@ void setup() {
|
||||
}
|
||||
```
|
||||
|
||||
## setBeep()
|
||||
|
||||
**機能:**
|
||||
|
||||
Beepで鳴らす音を設定します。
|
||||
|
||||
**構文:**
|
||||
|
||||
<mark>setBeep(uint16_t freq, uint16_t duration);</mark>
|
||||
|
||||
| 引数 | 説明 | 型 |
|
||||
| --- | --- | --- |
|
||||
| freq | 音の高さ(周波数Hz) | uint16_t |
|
||||
| duration | 鳴動時間 (ms)、 省略可能。 | uint16_t |
|
||||
|
||||
**使用例:**
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
M5.Speaker.setBeep(900, 1000);
|
||||
}
|
||||
```
|
||||
|
||||
<!--
|
||||
### <mark>tone</mark>
|
||||
> M5.Speaker.tone(uint32_t freq);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,47 @@
|
||||
# 喇叭
|
||||
|
||||
## begin()
|
||||
|
||||
**功能:**
|
||||
|
||||
Initialize the speaker.
|
||||
|
||||
**函数原型:**
|
||||
|
||||
<mark>begin();</mark>
|
||||
|
||||
**参数:**
|
||||
|
||||
None
|
||||
|
||||
**返回值:**
|
||||
|
||||
None
|
||||
|
||||
## end()
|
||||
|
||||
**功能:**
|
||||
|
||||
Mute the speakers and stop the output.
|
||||
|
||||
**函数原型:**
|
||||
|
||||
<mark>end();</mark>
|
||||
|
||||
**参数:**
|
||||
|
||||
None
|
||||
|
||||
**返回值:**
|
||||
|
||||
None
|
||||
|
||||
<!-- ### tone
|
||||
> M5.Speaker.tone(uint32_t freq);
|
||||
|
||||
设置声音音高
|
||||
|
||||
| Param | Type | Description |
|
||||
| 参数 | 型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| freq | <code>uint32_t</code> | 频率 |
|
||||
|
||||
@@ -40,3 +76,29 @@ M5.begin();
|
||||
|
||||
M5.Speaker.tone(900, 1000);
|
||||
```
|
||||
|
||||
## setBeep()
|
||||
|
||||
**功能:**
|
||||
|
||||
Set the beep sound.
|
||||
|
||||
**函数原型:**
|
||||
|
||||
<mark>setBeep(uint16_t freq, uint16_t duration);</mark>
|
||||
|
||||
| 参数 |描述 | 型 |
|
||||
| --- | --- |---|
|
||||
| freq | 声音频率 (Hz) | uint16_t |
|
||||
| duration | 持续时间 (单位:毫秒) | uint16_t |
|
||||
|
||||
**例程**
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
M5.Speaker.setBeep(900, 1000);
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user