I have try to build a scretch with chat gpt to help people with Alzheimer disease it show 3 commands on the screen and writing one of this commands on the computer arduino ide terminal will show the command in detail, you can change the command by your choose.
This was only an idea and needs to be developed more and more to work as a good guide, here the coding:
#include "Arduino_SensorKit.h"
void setup() {
Oled.begin();
Oled.setFlipMode(1); // Ruota il display (se necessario)
Serial.begin(9600); // Inizializza la comunicazione seriale
}
void loop() {
Oled.setFont(u8x8_font_chroma48medium8_r);
Oled.clearDisplay();
Oled.drawString(0, 0, "Percorso:");
Oled.drawString(0, 2, "1. Lavoro");
Oled.drawString(0, 3, "2. Scuola");
Oled.drawString(0, 4, "3. Casa");
Oled.refreshDisplay();
delay(1000);
// Attendi il comando dall'utente tramite seriale
if (Serial.available() > 0) {
String input = Serial.readStringUntil('\n');
// Stampa il comando sulla console seriale
Serial.println("Comando ricevuto: " + input);
Oled.clearDisplay();
Oled.setFont(u8x8_font_chroma48medium8_r);
// Converti la stringa in const char*
const char* inputChar = input.c_str();
// Utilizza la funzione drawString con const char*
Oled.drawString(0, 0, "Comando: ");
Oled.drawString(0, 2, inputChar);
// Gestisci i comandi e le azioni
if (input == "lavoro") {
// Aggiungi azioni specifiche per il percorso "lavoro"
} else if (input == "scuola") {
// Aggiungi azioni specifiche per il percorso "scuola"
} else if (input == "casa") {
// Aggiungi azioni specifiche per il percorso "casa"
} else {
// Comando sconosciuto
Oled.drawString(0, 4, "Comando sconosciuto");
}
Oled.refreshDisplay();
delay(2000);
Oled.clearDisplay();
Oled.refreshDisplay();
}
}