0.1.3 MiniMP3

This commit is contained in:
Rob Tillaart 2023-11-14 11:16:33 +01:00
parent be20f396e4
commit 6d788ddcfd
10 changed files with 211 additions and 10 deletions

View File

@ -0,0 +1,28 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
# - uno
# - due
# - zero
# - leonardo
# - m4
# - esp32
# - esp8266
- mega2560 # has a Serial1
# - rpipico

View File

@ -0,0 +1,46 @@
//
// FILE: MHZCO2_serial1_plotter.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo for MEGA / 2560 with Serial1
#include "Arduino.h"
#include "MHZCO2.h"
MHZ19B MHZ19B;
void setup()
{
Serial.begin(115200);
// Serial.println(__FILE__);
// Serial.print("MHZCO2_LIB_VERSION: ");
// Serial.println(MHZCO2_LIB_VERSION);
MHZ19B.begin(&Serial1);
Serial1.begin(9600);
// HEADER
Serial.println("CO2, MCO2, Temp, Accu");
}
void loop()
{
MHZ19B.measure();
Serial.print(MHZ19B.getCO2());
Serial.print(",");
Serial.print(MHZ19B.getMinCO2());
Serial.print(",");
Serial.print(MHZ19B.getTemperature());
Serial.print(",");
Serial.print(MHZ19B.getAccuracy());
Serial.println();
delay(1000);
}
// -- END OF FILE --

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.3] - 2023-11-14
- update readme.md
## [0.1.2] - 2023-05-01 ## [0.1.2] - 2023-05-01
- refactor & revitalize code - refactor & revitalize code
- create changelog.md - create changelog.md
@ -13,7 +17,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- add Stream parameter in constructor - add Stream parameter in constructor
- redo readme.md - redo readme.md
## [0.1.1] - 2018-06-12 ## [0.1.1] - 2018-06-12
- added volume, equalizer - added volume, equalizer

View File

@ -1,7 +1,7 @@
// //
// FILE: MiniMP3.cpp // FILE: MiniMP3.cpp
// AUTHOR: Rob.Tillaart@gmail.com // AUTHOR: Rob Tillaart
// VERSION: 0.1.2 // VERSION: 0.1.3
// PURPOSE: Arduino library for DFRobotics MP3 player and compatibles. // PURPOSE: Arduino library for DFRobotics MP3 player and compatibles.

View File

@ -2,14 +2,14 @@
// //
// FILE: MiniMP3.h // FILE: MiniMP3.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.2 // VERSION: 0.1.3
// PURPOSE: Arduino library for DFRobotics MP3 player and compatibles. // PURPOSE: Arduino library for DFRobotics MP3 player and compatibles.
// URL: https://github.com/RobTillaart/MINIMP3 // URL: https://github.com/RobTillaart/MINIMP3
#include "Arduino.h" #include "Arduino.h"
#define MINIMP3_LIB_VERSION (F("0.1.2")) #define MINIMP3_LIB_VERSION (F("0.1.3"))
// EQUALIZER MODI // EQUALIZER MODI
@ -45,7 +45,7 @@ public:
// plays SD:/MP3/####.mp3 // plays SD:/MP3/####.mp3
void play(uint16_t track); void play(uint16_t track);
// void playFolder(uint8_t folder, uint8_t track); // void playFolder(uint8_t folder, uint8_t track);
void next(); void next();
void prev(); void prev();
void stop(); void stop();

View File

@ -0,0 +1,28 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
# - uno
# - due
# - zero
# - leonardo
# - m4
# - esp32
# - esp8266
# - mega2560
# - rpipico

View File

@ -0,0 +1,96 @@
// FILE: MINIMP3_test_SWSerialOut.ino
// AUTHOR: Rob Tillaart
// PURPOSE: test
// URL: https://github.com/RobTillaart/MINIMP3
//
//
// MINI MP3
// +-----__-----+
// VCC | | BUSY
// RX | | USB-
// TX | | USB+
// DAC_R | | ADKEY_2
// DAC_L | +------+ | ADKEY_1
// SPK_1 | | | | IO_2
// GND | | SD | | GND
// SPK_2 | | CARD | | IO_1
// +--+------+--+
//
// When connecting to a 5V MCU, you need to add a 1K resistor between
// the Serial TX and RX as the MINIMP3 is 3V3. Otherwise a big HUM.
//
#include "Arduino.h"
#include "MiniMP3.h"
#include "SWSerialOut.h"
SWSerialOut sws(7); // RX, TX
MINIMP3 MP3(&sws);
uint8_t vol = 10;
uint8_t eq = 0;
void setup()
{
Serial.begin(115200);
while (!Serial);
Serial.println();
Serial.println(__FILE__);
sws.begin(9600);
MP3.reset();
delay(3000);
MP3.play(1);
MP3.volume(10);
}
void loop()
{
if (Serial.available())
{
char c = Serial.read();
switch (c)
{
case '0'...'9':
MP3.play(c - '0');
break;
case 'n':
MP3.next();
break;
case 'p':
MP3.prev();
break;
case '+':
if (vol < 20) vol++;
MP3.volume(vol);
break;
case '-':
if (vol > 0) vol--;
MP3.volume(vol);
break;
case 'e':
if (eq > 5) eq = 0;
MP3.equalizer(eq);
break;
case 's':
MP3.pause();
break;
case '?':
Serial.println("0..9 play song");
Serial.println("n = next");
Serial.println("p = previous");
Serial.println("+ = volume up");
Serial.println("- = volume down");
Serial.println("e = next equalizer");
Serial.println("s = stop");
break;
}
}
}
// -- END OF FILE --

View File

@ -16,7 +16,7 @@ packages:
compile: compile:
# Choosing to run compilation tests on 2 different Arduino platforms # Choosing to run compilation tests on 2 different Arduino platforms
platforms: platforms:
- uno # - uno
# - due # - due
# - zero # - zero
# - leonardo # - leonardo
@ -24,4 +24,4 @@ compile:
# - esp32 # - esp32
# - esp8266 # - esp8266
# - mega2560 # - mega2560
- rpipico # - rpipico

View File

@ -15,7 +15,7 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/MiniMP3.git" "url": "https://github.com/RobTillaart/MiniMP3.git"
}, },
"version":"0.1.2", "version":"0.1.3",
"license": "MIT", "license": "MIT",
"frameworks": "*", "frameworks": "*",
"platforms": "*", "platforms": "*",

View File

@ -1,5 +1,5 @@
name=MiniMP3 name=MiniMP3
version=0.1.2 version=0.1.3
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Minimal MP3 DFURobotics library for Arduino. sentence=Minimal MP3 DFURobotics library for Arduino.