// Modulo WTV020-SD-16P
// Conectamos el sensor de la siguiente forma:
// GND -> GND
// VDD -> 3,3V
// CLK -> D3
// DAT -> D4
// BUSY-> D5
// http://9arduino.blogspot.com
// Librerias necesarias
#include "Wtv020sd16p.h"
int resetPin = 2; // The pin number of the reset pin.
int clockPin = 3; // The pin number of the clock pin.
int dataPin = 4; // The pin number of the data pin.
int busyPin = 5; // The pin number of the busy pin.
int numberOfFiles = 2;
Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin);
void setup() {
Serial.begin(9600);
//Initializes the module.
wtv020sd16p.reset();
wtv020sd16p.playVoice(0);
}
int i = 0;
void loop() {
delay(100);
if (digitalRead(busyPin) == 0) {
wtv020sd16p.stopVoice();
Serial.println("standing track");
wtv020sd16p.asyncPlayVoice(i);
Serial.print("Beginning of the track ");
Serial.println(i);
i++;
}
else {
Serial.print("continuous track ");
if((i-1)<0) i = numberOfFiles;
Serial.println(i-1);
}
if(i== numberOfFiles) i = 0;
}
วันอาทิตย์ที่ 22 กันยายน พ.ศ. 2556
ใช้ Arduino กับ MP3 Module(WTV020SD-16P) ราคาประหยัด
โปรเจคนี้ผมตั้งใจใช้ Arduino กับ MP3 Module(WTV020SD-16P) เล่นไฟล์เพลงต่อเนื่องและวงรอบไปเรื่อยๆครับ
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)

ไม่มีเสียงออกเลยครับ ไม่รู้ว่าผลเป็นไงบ้างครับ
ตอบลบMICRO SD CARD ความจุสูงสุดไม่เกิน 1GBนะครับ
ตอบลบที่มาจาก
http://forum.arduino.cc/index.php/topic,117009.0.html