changes used library for dfplayer

This commit is contained in:
Marcel 2024-05-27 11:17:53 +02:00
parent 43d31651cd
commit 6997f3c98f
5 changed files with 24 additions and 86 deletions

View file

@ -1,17 +1,22 @@
#include "Context.h"
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFRobotDFPlayerMini* dfPlayer) {
this->stations = stations;
this->stationCount = stationCount;
this->delta = delta;
this->dfPlayer = dfPlayer;
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFPlayerMini_Fast* dfPlayer)
{
this->stations = stations;
this->stationCount = stationCount;
this->delta = delta;
this->dfPlayer = dfPlayer;
}
int Context::getStationIndex(const Station* station) const
{
for (int i = 0; i < stationCount; ++i) {
if (&stations[i] == station) {
return i;
for (int i = 0; i < stationCount; ++i)
{
if (&stations[i] == station)
{
return i;
}
}
}
return -1;
return -1;
}