Hello, I would like to create game like a Milionaire that person have to choose one of three answers and that will gives him point if he answer correct but I would like to do it effective that in Visual Studio I will make a program and you will write all questions and answers there and when you connect Arduino to PC it will automatically download the latest questions ... But now I need help, I would like to do this easier in Serial Monitor ... I would like to do that If I start program, it will ask me for question num. 1, I will write there something and after it will load .. But If I write there something it will ignore it .. look in the code.
word Q0;
word Q0A1 = "Odpoved1";
word Q0A2 = "Odpoved2";
word Q0A3 = "Odpoved3";
struct otazky_str {const char* q; const char *a1; const char *a2; const char *a3; byte spravne;};
otazky_str otazky[] = {
{Q0, Q0A1, Q0A2, Q0A3, 1},
};
const int pocetOtazok = sizeof(otazky) / sizeof(otazky_str);
void setup()
{
Serial.begin(9600);
Serial.println("Zadajte prvú otázku");
while (Serial.available() == 0){ }
Q0 = Serial.parseInt();
for (int i = 0; i < pocetOtazok; i++) {
Serial.print("Otázka #"); Serial.print(i + 1); Serial.print(": ");
Serial.print(otazky[i].q); Serial.println();
Serial.println("Dostupné odpovede:");
Serial.print("1: "); Serial.print(otazky[i].a1); Serial.println();
Serial.print("2: "); Serial.print(otazky[i].a2); Serial.println();
Serial.print("3: "); Serial.print(otazky[i].a3); Serial.println();
}
}
void loop() {
}