Перенос с UNO на MEGA
- Войдите на сайт для отправки комментариев
Ср, 23/09/2015 - 10:31
Добрый день!
Есть mp3 плеер VS1053. На UNO поет песни, а MEGA его не видит.
Говорит : Couldn't find VS1053, do you have the right pins defined?
Пины на месте, там физически не перепутать
Код одинаковый:
// include SPI, MP3 and SD libraries #include <SPI.h> #include <Adafruit_VS1053.h> #include <SD.h> // define the pins used //#define CLK 13 // SPI Clock, shared with SD card //#define MISO 12 // Input data, from VS1053/SD card //#define MOSI 11 // Output data, to VS1053/SD card // Connect CLK, MISO and MOSI to hardware SPI pins. // See http://arduino.cc/en/Reference/SPI "Connections" // These are the pins used for the breakout example #define BREAKOUT_RESET 8 // VS1053 reset pin (output) #define BREAKOUT_CS 6 // VS1053 chip select pin (output) #define BREAKOUT_DCS 7 // VS1053 Data/command select pin (output) // These are the pins used for the music maker shield #define SHIELD_RESET 8 // VS1053 reset pin (unused!) #define SHIELD_CS 6 // VS1053 chip select pin (output) #define SHIELD_DCS 7 // VS1053 Data/command select pin (output) // These are common pins between breakout and shield #define CARDCS 9 // Card chip select pin // DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt #define DREQ 2 // VS1053 Data request, ideally an Interrupt pin Adafruit_VS1053_FilePlayer musicPlayer = // create breakout-example object! //Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS); // create shield-example object! Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS); void setup() { Serial.begin(9600); Serial.println("Adafruit VS1053 Simple Test"); if (! musicPlayer.begin()) { // initialise the music player Serial.println(F("Couldn't find VS1053, do you have the right pins defined?")); while (1); } Serial.println(F("VS1053 found"));
Помогте советом.
В Меге:
В Уно:
спасибо.
можно поподробнее? я ведь у себя 10-13 пины не использую...
у меня только 2, 6,7,8,9
А сд карта?
воткнута на ней файл, и UNO его воспроизводит.
Для карты нужн шына SPI.
В уно это пины:10,11,12,13
В мегы это пины: 50,51,52,53
Попробуй на перемичках подключить, 10,11,12,13 к 50,51,52,53 как вариант.
Сделал, не помогло.
SD карту он инициализиует по коду позже чем саму плату плеера.
То есть ошибка именно в пинах плеера или чем то еще (
50 (MISO), 51 (MOSI) местами меняли? с ними часто трабл случается
получилось, всем спасибо