DFRobot DFR0699 Handbuch - Seite 12
Blättern Sie online oder laden Sie pdf Handbuch für Kontrolleinheit DFRobot DFR0699 herunter. DFRobot DFR0699 20 Seiten.
#include "DFRobot_VoiceRecorder.h"
#define I2C_ADDRESS
(0x30)
DFRobot_VoiceRecorder_I2C voicerecorder(&Wire, I2C_ADDRESS);
uint16_t AnalogRaw0;
float AnalogVolt0;
void setup()
{
Serial.begin(115200);
while (voicerecorder.begin() != 0)
{
Serial.println("i2c device number error!");
delay(1000);
}
Serial.println("i2c connect success!");
}
void loop()
{
AnalogRaw0 = analogRead(A0);
AnalogVolt0 = 5.0 * AnalogRaw0 / 1024;
Serial.println(String(AnalogRaw0));
voicerecorder.VoiceSynthesis(CHINESE_LANGUAGE, String(AnalogRaw0), VOICE_SYNTHESIS_MODE);
while (voicerecorder.getNowState() != VOICE_NONE);
delay(1000);
//I2C Address