mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
Правильно иницилизируем подключение Mp3 плеера
This commit is contained in:
@@ -18,10 +18,15 @@ class Mp3 : public IoTItem {
|
|||||||
int pinRx = selectFromMarkerToMarker(tmpstr, ",", 0).toInt();
|
int pinRx = selectFromMarkerToMarker(tmpstr, ",", 0).toInt();
|
||||||
int pinTx = selectFromMarkerToMarker(tmpstr, ",", 1).toInt();
|
int pinTx = selectFromMarkerToMarker(tmpstr, ",", 1).toInt();
|
||||||
mySerial = new SoftwareSerial(pinRx, pinTx);
|
mySerial = new SoftwareSerial(pinRx, pinTx);
|
||||||
|
pinMode(pinRx, INPUT);
|
||||||
|
pinMode(pinTx, OUTPUT);
|
||||||
|
|
||||||
jsonRead(parameters, "volume", volumetmp);
|
jsonRead(parameters, "volume", volumetmp);
|
||||||
|
|
||||||
if (mySerial) myMP3 = new DFRobotDFPlayerMini();
|
if (mySerial) {
|
||||||
|
mySerial->begin(9600);
|
||||||
|
myMP3 = new DFRobotDFPlayerMini();
|
||||||
|
}
|
||||||
if (myMP3) {
|
if (myMP3) {
|
||||||
myMP3->begin(*mySerial);
|
myMP3->begin(*mySerial);
|
||||||
myMP3->volume(volumetmp);
|
myMP3->volume(volumetmp);
|
||||||
|
|||||||
Reference in New Issue
Block a user