Bluetooth üzerinden Arduino'nuza sesli komutlar gönderin, işlemi tamamlayın ve Serial.print ile geri yanıt verin. Verdiğiniz yanıtı mobil cihazınızdan sesli olarak alacaksınız!
Örnek Arduino Kodu (Example Arduino Code):
String readString = "";
#define led 13 //
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, LOW);
Serial.begin(9600);
}
void loop() {
while (Serial.available()) {
char c = (char)Serial.read();
readString += c;
}
if (readString.length() > 0) {
if (readString == "aç") {
digitalWrite(led, HIGH);
Serial.print("açıldı");
}
else if (readString == "kapat") {
digitalWrite(led, LOW);
Serial.print("kapandı");
}
else if (readString == "ev kaç derece") {
//derece hesaplama işlemleri vb.
Serial.print("ev şuan 21 derece");
}
else if (readString == "İngilizce konuş") {
Serial.print("Hi, how are you?");
}
else {
Serial.print("Seni anlayamadım.");
}
readString = "";
}
delay(100);
}
Send your Arduino via Bluetooth, voice commands, and responds back to finish with Serial.print. You will receive your responses aloud from your mobile device!
Arduino Example Code (the Arduino Example Code):
ReadString String = "";
#define LED 13 //
void setup () {
In pinmo (LED, OUTPUT);
digitalwrit (LEDs, LOW);
Serial.beg the (9600);
}
void loop () {
while (Serial.availabl A ()) {
char c = (char) Serial.read ();
ReadString + = c;
}
if (readstring.length ()> 0) {
if (ReadString == "open") {
digitalwrit (LEDs, HIGH);
Serial.print ( "opened");
}
else if (ReadString == "off") {
digitalwrit (LEDs, LOW);
Serial.print ( "closed");
}
else if (ReadString == "very few houses") {
// degree calculation processing and so on.
Serial.print ( "home now 21 degrees");
}
else if (ReadString == "speak English") {
Serial.print ( "Hi, how are you?");
}
else {
Serial.print ( "I do not understand you.");
}
ReadString = "";
}
delay (100);
}