Serial print not work

hallo,

i found the code from internet

#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

SoftwareSerial mySoftwareSerial(10, 11); // RX, TX
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);

#define SENSORPIN 9
#define PAUSETIME 20000

void setup() {
  mySoftwareSerial.begin(9600);
  Serial.begin(115200);
  pinMode(SENSORPIN, INPUT);

  Serial.println();
  Serial.println("Initializing DFPlayer...");

  //Use softwareSerial to communicate with MP3
  if (!myDFPlayer.begin(mySoftwareSerial)) {
    Serial.println("Unable to begin:");
    Serial.println("1.Please recheck the connection!");
    Serial.println("2.Please insert the SD card!");
    while (true);
  }
  Serial.println("DFPlayer Mini online.");

  //Set volume value (From 0 to 30)
  myDFPlayer.volume(25);
}

void sensorActivated() {
  int pirSensor = digitalRead(SENSORPIN);
  if (pirSensor == HIGH)
  {
    Serial.println("Sensor Activated");
    Serial.println("DFPlayer Working...");
    myDFPlayer.play(1);
  }
  return;
}

void loop() {
   Serial.println("test");
  sensorActivated();
  delay(PAUSETIME);
}

but on Monitor it show it print like this ⸮⸮⸮⸮⸮⸮⸮⸮⸮

any idea ?

Thanks in advance

set the baud rate in Serial Monitor to 115200

YES....thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.