Skip to content

Commit 17dbe80

Browse files
Merge pull request #111 from Serasidis/patch-3
Updates to Serasidis_VS1003B_STM library - Updated the example for using it with the new one SPI library.
2 parents 4f1e890 + 89a5a66 commit 17dbe80

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

  • STM32F1/libraries/Serasidis_VS1003B_STM/examples/hello_STM

STM32F1/libraries/Serasidis_VS1003B_STM/examples/hello_STM/hello_STM.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,13 @@ static const unsigned char HelloMP3[] = {
190190
0x00
191191
};
192192

193-
VS1003 player(PC14, PB10, PA8, PA9); // cs_pin, dcs_pin, dreq_pin, reset_pin, SPI channel - defaults to SPI
193+
//Un-comment the line with the SPI port you want to use. Default is SPI1 port.
194+
SPIClass spiVS(1); //Create an SPI instance on SPI1 port.
195+
//SPIClass spi(2); //Create an SPI instance on SPI2 port.
196+
//SPIClass spi(3); //Create an SPI instance on SPI3 port.
194197

195-
/* Example of how to use the VS21003 attached to SPI 2
196-
VS1003 player(PC14, PB10, PA8, PA9,SPIClass(2)); // cs_pin, dcs_pin, dreq_pin, reset_pin, use SPI 2
197-
*/
198+
VS1003 player(PC14, PB10, PA8, PA9, spiVS); // cs_pin, dcs_pin, dreq_pin, reset_pin, SPI channel - defaults to SPI
198199

199-
/* Example of how to use the VS21003 attached to SPI 2
200-
VS1003 player(PC14, PB10, PA8, PA9,SPIClass(3)); // cs_pin, dcs_pin, dreq_pin, reset_pin, use SPI 3
201-
*/
202200
void setup ()
203201
{
204202
Serial.begin(9600);
@@ -212,4 +210,4 @@ void setup ()
212210
void loop() {
213211
player.playChunk(HelloMP3, sizeof(HelloMP3)); // play hellomp3 - this blocks until the player is ready to receive more data
214212
delay(1000);
215-
}
213+
}

0 commit comments

Comments
 (0)