aboutsummaryrefslogtreecommitdiff
path: root/remote-wheels.ino
diff options
context:
space:
mode:
Diffstat (limited to 'remote-wheels.ino')
-rw-r--r--remote-wheels.ino28
1 files changed, 28 insertions, 0 deletions
diff --git a/remote-wheels.ino b/remote-wheels.ino
index 2f1e548..816a412 100644
--- a/remote-wheels.ino
+++ b/remote-wheels.ino
@@ -35,6 +35,33 @@ void printConfig() {
Serial.println();
}
+String readString() {
+ String cmd = Serial.readString();
+ cmd.trim();
+
+ return cmd;
+}
+
+void parseCommand() {
+ if (Serial.available() <= 0) return;
+
+ String cmd = readString();
+
+ if (cmd.equals("aiuto")) {
+ printHelp();
+ } else if (cmd.equals("set ssid")) {
+ Serial.println("Inserisci SSID");
+ Serial.readString();
+ wifi_ssid = readString();
+ Serial.println("OK.");
+ } else if (cmd.equals("set password")) {
+ } else if (cmd.equals("print ssid")) {
+ } else if (cmd.equals("print password")) {
+ } else if (cmd.equals("print config")) {
+ printConfig();
+ }
+}
+
void setup()
{
delay(3000);
@@ -45,4 +72,5 @@ void setup()
void loop()
{
+ parseCommand();
}