Skip to content

Commit 0413821

Browse files
committed
added speaker.end func
2 parents 567596c + be88af0 commit 0413821

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
do NOT use the Windows 10 Universal (v10.1.1) driver! If you happen to download the Universal version, you may need to manually revert to 6.7.1
77
on a regular basis as Windows will repeatedly use the newer, incorrect driver after each Windows update.
88

9-
(Note:If you cannot upload, please try the legacy v4 driver below. Note you will need to uninstall the v5 driver.And try to use the low band: 115200)
10-
- [Download the Silabs CP210X v10 Driver Universal binary for win 10 in case of rebooting problems while flashing procedure] (https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver.zip )
11-
No need of reinstaling any drivers if were installed before, they should be updated "on the fly"
9+
(Note: If you cannot upload, please try the legacy v4 driver below. You will need to uninstall the v5 driver. And try to use a lower baudrate: 115200)
10+
- [Download the Silabs CP210X v10 Driver Universal binary for win 10 in case of rebooting problems while flashing procedure](https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver.zip)
11+
No need of reinstalling any drivers if were installed before, they should be updated "on the fly".
1212

1313
### Installing the ESP32 Arduino Core
1414
- Using Arduino IDE
@@ -44,16 +44,15 @@ cd %USERPROFILE%\documents\libraries
4444
git clone https://github.com/m5stack/M5Stack.git
4545
```
4646

47-
4847
## API
4948
See [API](https://github.com/m5stack/M5Stack/blob/master/src/M5Stack.h#L19).
5049

5150
## Examples
5251
See [examples](examples) folder.
5352

54-
5553
## Hardware
5654
[Schematic](https://github.com/m5stack/M5-hardware/blob/master/M5_Core_SCH(20171206).pdf).
55+
5756
### Pinout
5857
Peripheral Devices | ESP32
5958
---|---
@@ -76,7 +75,6 @@ MPU9250 SCL | GPIO22
7675
GROVE SDA | GPIO21
7776
GROVE SCL | GPIO22
7877

79-
8078
### LoRa module
8179
Peripheral Devices | ESP32 | RA-02 | Note
8280
---|---|---|---
@@ -87,6 +85,5 @@ RFM95_CS | GPIO5 | NSS | pull up before M5.Begin()
8785
RFM95_RST | GPIO36 | RST | incorrectly labeled GPIO26 in some places
8886
RFM95_INT | GPIO26 | DIO0 | incorrectly labeled GPIO36 in some places
8987

90-
9188
### M-BUS
9289
![image](docs/M-BUS.jpg)

src/utility/Speaker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ void SPEAKER::begin() {
1111
setBeep(1000, 100);
1212
}
1313

14+
void SPEAKER::end() {
15+
ledcDetachPin(SPEAKER_PIN);
16+
}
17+
1418
void SPEAKER::tone(uint16_t frequency) {
1519
ledcWriteTone(TONE_PIN_CHANNEL, frequency);
1620
}

src/utility/Speaker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class SPEAKER {
1313
SPEAKER(void);
1414

1515
void begin();
16+
void end();
1617
void mute();
1718
void tone(uint16_t frequency);
1819
void tone(uint16_t frequency, uint32_t duration);

0 commit comments

Comments
 (0)