buenzliai/src/audioState.h
2024-05-23 16:16:00 +02:00

73 lines
1.8 KiB
C

#pragma once
#include <Arduino.h>
#include <DFRobotDFPlayerMini.h>
#include <LiquidCrystal.h>
void printMp3Detail(LiquidCrystal* lcd, uint8_t type, int value)
{
lcd->clear();
switch (type)
{
case TimeOut:
lcd->print("Time Out!");
break;
case WrongStack:
lcd->print("Stack Wrong!");
break;
case DFPlayerCardInserted:
lcd->print("Card Inserted!");
break;
case DFPlayerCardRemoved:
lcd->print("Card Removed!");
break;
case DFPlayerCardOnline:
lcd->print("Card Online!");
break;
case DFPlayerUSBInserted:
lcd->print("USB Inserted!");
break;
case DFPlayerUSBRemoved:
lcd->print("USB Removed!");
break;
case DFPlayerPlayFinished:
lcd->print("Num:");
lcd->print(value);
lcd->print(" Finished!");
break;
case DFPlayerError:
lcd->print("DFPlayerError:");
switch (value)
{
case Busy:
lcd->print("Card not found");
break;
case Sleeping:
lcd->print("Sleeping");
break;
case SerialWrongStack:
lcd->print("Wrong Stack");
break;
case CheckSumNotMatch:
lcd->print("Checksum Error");
break;
case FileIndexOut:
lcd->print("File Index OOB");
break;
case FileMismatch:
lcd->print("File Mismatch");
break;
case Advertise:
lcd->print("In Advertise");
break;
default:
lcd->print("Unknown Error");
break;
}
break;
default:
lcd->print("Unknown Type");
break;
}
delay(2000); // Display the message for 2 seconds
}