fix: hall music_player
This commit is contained in:
Binary file not shown.
Submodule FW/leo_muziekdoos_esp32/lib/NDEF updated: 67b18f2c02...c7262f2108
@@ -8,6 +8,8 @@ AudioOutputI2S *out;
|
||||
uint8_t audio_current_Song = 0;
|
||||
uint8_t n = 0;
|
||||
|
||||
bool audio_start = false;
|
||||
|
||||
const char *waveFile[] =
|
||||
{"/ringoffire.mp3",
|
||||
"/Let_it_be.mp3",
|
||||
@@ -83,10 +85,17 @@ void handleAudio()
|
||||
{
|
||||
Serial.println("Audio: stop playback");
|
||||
mp3->stop();
|
||||
audio_start = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!audio_start)
|
||||
{
|
||||
playSong(audio_current_Song);
|
||||
audio_start = true;
|
||||
}
|
||||
|
||||
if (mp3->isRunning())
|
||||
{
|
||||
if (!mp3->loop())
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "game.h"
|
||||
|
||||
#define AUDIOGAIN 0.25
|
||||
#define AUDIOGAIN 0.5
|
||||
#define AUDIONSONGS 3
|
||||
#define AUDIOREPEATS 3
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ bool hall_is_Idle = true;
|
||||
void initGame(void)
|
||||
{
|
||||
pinMode(HALL_INPUT, ANALOG);
|
||||
//analogReadResolution(10);
|
||||
analogSetAttenuation(ADC_11db);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +28,7 @@ void handleGame(void)
|
||||
if(hall_idle_count > HALLIDLESAMPLES)
|
||||
{
|
||||
hall_is_Idle = false;
|
||||
hall_idle_count = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "board.h"
|
||||
|
||||
#define HALLINTERVAL 200
|
||||
#define HALLIDLETHRESHOLD 11
|
||||
#define HALLIDLESAMPLES 4
|
||||
#define HALLIDLETHRESHOLD 6
|
||||
#define HALLIDLESAMPLES 2
|
||||
|
||||
void initGame(void);
|
||||
void handleGame(void);
|
||||
|
||||
Reference in New Issue
Block a user