From 4247f11c9c10ccb4698d7543fb6ffd98bf1ff818 Mon Sep 17 00:00:00 2001 From: koba Date: Sat, 29 Aug 2020 01:55:43 +0900 Subject: [PATCH 1/2] bug fix --- src/main/main.ino | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/main.ino b/src/main/main.ino index ffe49a6..fb58ea7 100644 --- a/src/main/main.ino +++ b/src/main/main.ino @@ -24,6 +24,7 @@ char* filePositiveARMarker = "/filePositiveARMarker.jpg"; char* filePositiveMP3 = "/filePositiveMP3.mp3"; char* fileNegativeARMarker = "/fileNegativeARMarker.jpg"; char* fileNegativeMP3 = "/fileNegativeMP3.mp3"; +char* fileDefault = "/fileDefault.jpg"; /* Plays MP3 */ void playMP3(char *filename){ @@ -36,10 +37,10 @@ void playMP3(char *filename){ mp3->begin(id3, out); } -/* Draws 200x200 JPG file */ +/* Draws 320x240 JPG file */ void drawARMarker(char *filename) { - uint16_t x = 60; - uint16_t y = 20; + uint16_t x = 40; + uint16_t y = 0; M5.Lcd.fillScreen(TFT_BLACK); M5.Lcd.drawJpgFile(SD, filename, x, y); @@ -65,10 +66,13 @@ void handleStatus() { if (postdata == "positive"){ drawARMarker(filePositiveARMarker); + mp3->stop(); playMP3(filePositiveMP3); server.send(200, "text/plain", "Positive audio start"); } else if (postdata == "negative"){ drawARMarker(fileNegativeARMarker); + mp3->stop(); + delay(10000); playMP3(fileNegativeMP3); server.send(200, "text/plain", "Cheering audio start"); } else if (postdata == "off"){ @@ -134,8 +138,9 @@ void setup(){ // LCD display M5.Lcd.setTextSize(3); - M5.Lcd.println("Waiting"); - + drawARMarker(fileDefault); + Serial.println("Waiting"); + playMP3(filePositiveMP3); mp3->stop(); } From 46eb547cc6824bab626da0534e6eb1e7ac730a80 Mon Sep 17 00:00:00 2001 From: Masapyon <38831868+ocucraqp@users.noreply.github.com> Date: Sat, 29 Aug 2020 17:11:57 +0900 Subject: [PATCH 2/2] Update main.ino --- src/main/main.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/main.ino b/src/main/main.ino index fb58ea7..e147038 100644 --- a/src/main/main.ino +++ b/src/main/main.ino @@ -37,7 +37,7 @@ void playMP3(char *filename){ mp3->begin(id3, out); } -/* Draws 320x240 JPG file */ +/* Draws 240x240 JPG file */ void drawARMarker(char *filename) { uint16_t x = 40; uint16_t y = 0; @@ -76,7 +76,7 @@ void handleStatus() { playMP3(fileNegativeMP3); server.send(200, "text/plain", "Cheering audio start"); } else if (postdata == "off"){ - M5.Lcd.fillScreen(TFT_BLACK); + drawARMarker(fileDefault); mp3->stop(); server.send(200, "text/plain", "audio end"); }