changes of previous commit reverted
This commit is contained in:
parent
6997f3c98f
commit
662464d34d
5 changed files with 7 additions and 8 deletions
|
@ -16,4 +16,3 @@ lib_deps =
|
|||
adafruit/Adafruit BusIO@^1.16.1
|
||||
dfrobot/DFRobotDFPlayerMini@^1.0.6
|
||||
fmalpartida/LiquidCrystal@^1.5.0
|
||||
powerbroker2/DFPlayerMini_Fast@^1.2.4
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "Context.h"
|
||||
|
||||
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFPlayerMini_Fast* dfPlayer)
|
||||
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFRobotDFPlayerMini* dfPlayer)
|
||||
{
|
||||
this->stations = stations;
|
||||
this->stationCount = stationCount;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#pragma once
|
||||
#include <DFPlayerMini_Fast.h>
|
||||
#include <DFRobotDFPlayerMini.h>
|
||||
#include "station.h"
|
||||
|
||||
class Context {
|
||||
public:
|
||||
Context(Station* stations, int stationCount, unsigned long delta, DFPlayerMini_Fast* dfPlayer);
|
||||
Context(Station* stations, int stationCount, unsigned long delta, DFRobotDFPlayerMini* dfPlayer);
|
||||
|
||||
Station* stations;
|
||||
int stationCount;
|
||||
unsigned long delta;
|
||||
DFPlayerMini_Fast* dfPlayer;
|
||||
DFRobotDFPlayerMini* dfPlayer;
|
||||
|
||||
int getStationIndex(const Station* station) const;
|
||||
bool isPlaying() const;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <SPI.h>
|
||||
#include <Adafruit_PN532.h>
|
||||
#include <SoftwareSerial.h>
|
||||
#include <DFPlayerMini_Fast.h>
|
||||
#include <DFRobotDFPlayerMini.h>
|
||||
|
||||
#include "station.h"
|
||||
#include "statemachine.h"
|
||||
|
@ -22,7 +22,7 @@ constexpr int rs = 9, en = 8, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
|
|||
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
|
||||
|
||||
SoftwareSerial softSerial(6, 7); // RX, TX
|
||||
DFPlayerMini_Fast dfPlayer;
|
||||
DFRobotDFPlayerMini dfPlayer;
|
||||
|
||||
Station stations[5] = {
|
||||
Station(1680767519, "Yellow"), Station(3346823711, "Green"), Station(3569318175, "Pink"),
|
||||
|
@ -176,7 +176,6 @@ void setup(void)
|
|||
while (true)
|
||||
{
|
||||
delay(100);
|
||||
dfPlayer.printError();
|
||||
// printMp3Detail(&lcd, dfPlayer.readType(), dfPlayer.read());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,6 +150,7 @@ State* Hacking::update(const Context context)
|
|||
{
|
||||
Serial.println(String(context.delta));
|
||||
const bool done = timer.update(context.delta);
|
||||
|
||||
if (done)
|
||||
{
|
||||
const int currentStationIndex = context.getStationIndex(currentStation);
|
||||
|
|
Loading…
Reference in a new issue