Guten Tag, habe folgendes Problem, Ich bekomme die Richtigen Wörter auf dem Display angezeigt das funzt schon mal ganz gut, nun wollte ich mir die Wörter noch per Sprache aus geben lassen.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_HMC5883_U.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
#include <pgmspace.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 128
#define i2c_Address 0x3C
#define BUZZER_PIN 26
Adafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);
Adafruit_SH1107 display = Adafruit_SH1107(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
float lastTotalMag = 0;
float threshold = 2.5;
char current_word_buffer[25] = "BEREIT";
const char* word_table[] = {
"ANWESEND", "GEIST", "HILFE", "GEFAHR", "LICHT",
"DUNKEL", "KALT", "WARM", "HOERE", "FOLGE",
"RAUS", "BLEIB", "HIER", "DORT", "KIND",
"FRAU", "MANN", "ALT", "JUNG", "NAME",
"ZEIT", "HEUTE", "NACHT", "STIMME", "LACHEN",
"WEINEN", "ANGST", "BOESE", "GUT", "TOT",
"LEBEN", "GRAB", "KELLER", "DACH", "TUER",
"FENSTER", "VERLASSEN", "VERSTECKT", "SUCHE", "GEFUNDEN",
"ENERGIE", "PORTAL", "SCHMERZ", "LIEBE", "WARTEN",
"JETZT", "NIEMALS", "KOMME", "GEHE", "FRAGE"
};
usw
im Loop hab ich
if (delta > threshold) {
int index = abs((int)(totalMag * 100)) % word_count;
snprintf(current_word_buffer, 25, "%s", word_table[index]);
toneOK();
}
display.setTextSize(2);
int16_t x1, y1; uint16_t w, h;
display.getTextBounds(current_word_buffer, 0, 0, &x1, &y1, &w, &h);
display.setCursor((SCREEN_WIDTH - w) / 2, 55);
display.print(current_word_buffer);
int barWidth = map((int)(delta * 10), 0, 100, 0, 124);
display.drawRect(0, 110, 128, 15, SH110X_WHITE);
display.fillRect(2, 112, barWidth, 11, SH110X_WHITE);
display.display();
ich finde nix was mir die Wörter die über
display.print(current_word_buffer);
abgezeigt werden auch auf Deutsch ausgibt hat wer von euch eine Idee wie ich das machen könnte?
mfg amsel
