Remarks

Yx5300
Status
Source code GitHub
NuGet package

Code Example

public MeadowApp()
{
    Console.WriteLine("Initialize hardware...");

    var mp3Player = new Yx5300(Device, Device.SerialPortNames.Com4);

    //using an async task - this code would likely go in an async method
    Task.Run(async () =>
    {
        mp3Player.SetVolume(15);

        var status = await mp3Player.GetStatus();
        Console.WriteLine($"Status: {status}");

        var count = await mp3Player.GetNumberOfTracksInFolder(0);
        Console.WriteLine($"Number of tracks: {count}");

        mp3Player.Play();

        await Task.Delay(5000); //leave playing for 5 seconds

        mp3Player.Next();

        await Task.Delay(5000); //leave playing for 5 seconds
    });
}

Sample project(s) available on GitHub

Wiring Example

To wire a Yx5300 to your Meadow board, connect the following:

Yx5300 Meadow Pin
GND GND
VCC 3.3V
RX D01
TX D00

Characteristic Locus
Inheritance System.Object > Yx5300
Namespace Meadow.Foundation.Audio.Mp3
Assembly Yx5300.dll

Syntax

public class Yx5300 : object

Constructors

Yx5300(IMeadowDevice, SerialPortName)

Declaration
public Yx5300(IMeadowDevice device, SerialPortName serialPortName)

Parameters

Type Name Description
IMeadowDevice device
SerialPortName serialPortName

Yx5300(ISerialPort)

Declaration
protected Yx5300(ISerialPort serialPort)

Parameters

Type Name Description
ISerialPort serialPort

Methods

GetIndexOfCurrentFile()

Declaration
public Task<byte> GetIndexOfCurrentFile()

Returns

Type Description
Task<System.Byte>

GetNumberOfFolders()

Declaration
public Task<byte> GetNumberOfFolders()

Returns

Type Description
Task<System.Byte>

GetNumberOfTracksInFolder(Byte)

Declaration
public Task<byte> GetNumberOfTracksInFolder(byte folderIndex)

Parameters

Type Name Description
System.Byte folderIndex

Returns

Type Description
Task<System.Byte>

GetStatus()

Declaration
public Task<Yx5300.PlayStatus> GetStatus()

Returns

Type Description
Task<Yx5300.PlayStatus>

GetVolume()

Declaration
public Task<byte> GetVolume()

Returns

Type Description
Task<System.Byte>

Next()

Declaration
public void Next()

Pause()

Declaration
public void Pause()

Play()

Declaration
public void Play()

Play(Byte)

Declaration
public void Play(byte songIndex)

Parameters

Type Name Description
System.Byte songIndex

Previous()

Declaration
public void Previous()

Reset()

Declaration
public void Reset()

SetVolume(Byte)

Declaration
public void SetVolume(byte volume)

Parameters

Type Name Description
System.Byte volume

Sleep()

Declaration
public void Sleep()

Stop()

Declaration
public void Stop()

VolumeDown()

Declaration
public void VolumeDown()

VolumeUp()

Declaration
public void VolumeUp()

WakeUp()

Declaration
public void WakeUp()