From 89a5a661f335607591780fe59b690faa200749ea Mon Sep 17 00:00:00 2001 From: Vassilis Serasidis Date: Wed, 9 Sep 2015 12:33:42 +0300 Subject: [PATCH] Updated the example for using it with the new one SPI library. --- .../examples/hello_STM/hello_STM.ino | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/STM32F1/libraries/Serasidis_VS1003B_STM/examples/hello_STM/hello_STM.ino b/STM32F1/libraries/Serasidis_VS1003B_STM/examples/hello_STM/hello_STM.ino index a498597..8b02e1b 100644 --- a/STM32F1/libraries/Serasidis_VS1003B_STM/examples/hello_STM/hello_STM.ino +++ b/STM32F1/libraries/Serasidis_VS1003B_STM/examples/hello_STM/hello_STM.ino @@ -190,15 +190,13 @@ static const unsigned char HelloMP3[] = { 0x00 }; -VS1003 player(PC14, PB10, PA8, PA9); // cs_pin, dcs_pin, dreq_pin, reset_pin, SPI channel - defaults to SPI +//Un-comment the line with the SPI port you want to use. Default is SPI1 port. +SPIClass spiVS(1); //Create an SPI instance on SPI1 port. +//SPIClass spi(2); //Create an SPI instance on SPI2 port. +//SPIClass spi(3); //Create an SPI instance on SPI3 port. -/* Example of how to use the VS21003 attached to SPI 2 -VS1003 player(PC14, PB10, PA8, PA9,SPIClass(2)); // cs_pin, dcs_pin, dreq_pin, reset_pin, use SPI 2 -*/ +VS1003 player(PC14, PB10, PA8, PA9, spiVS); // cs_pin, dcs_pin, dreq_pin, reset_pin, SPI channel - defaults to SPI -/* Example of how to use the VS21003 attached to SPI 2 -VS1003 player(PC14, PB10, PA8, PA9,SPIClass(3)); // cs_pin, dcs_pin, dreq_pin, reset_pin, use SPI 3 -*/ void setup () { Serial.begin(9600); @@ -212,4 +210,4 @@ void setup () void loop() { player.playChunk(HelloMP3, sizeof(HelloMP3)); // play hellomp3 - this blocks until the player is ready to receive more data delay(1000); -} \ No newline at end of file +}