diff --git a/prog/prog.ino b/prog/prog.ino index 262b449..878b604 100644 --- a/prog/prog.ino +++ b/prog/prog.ino @@ -1,7 +1,42 @@ #include #include #include "Adafruit_VL53L0X.h" -#include "PCF8574.h" +#include +#include "terminal.hpp" +// +// ATTENTION : pour que les commandes se déclarent automatiquement au démarrage +// auprès du terminal, le fichier conteant la fonction setup() et loop() doit +// être mis en derniere position dans la liste des fichiers lors de l'édition +// des liens. +// Dans platformio, pour faire cela, il suffit de commencer le nom du fichier +// contenant les fonctions loop() et setup() par la lettre z. +// Par exemple : zzz_main.cpp. +// + +extern terminal_n::Terminal terminal; + + +TERMINAL_PARAMETER_INT( + terminal, + power_mode, // variable name to declare + "power_mode", // EEPROM name (15 char. max), + // If you dont want to save in EEPROM, set "" + "the power mode", // description + 0, // default constructor value + false, // auto save in eeprom after command modification + terminal_n::filter_nothing, // function to filter the value + terminal_n::do_nothing // function executed at the end of the command +); + +TERMINAL_COMMAND(terminal, ping, "Print pong followoing by the received arguments") +{ + terminal.print("pong"); + for (uint32_t i=0; i #include @@ -29,8 +64,10 @@ struct tube { int id; }; -const int minHeight = 50; -const int maxHeight = 445; +struct tube all_tubes[6] = {0}; + +const float minHeight = 50; +const float maxHeight = 445; int minServo = 0; int maxServo = 180; @@ -48,7 +85,7 @@ AsyncWebServer server(80); const char index_html[] PROGMEM = R"rawliteral( - ESP Web Server + Balle Ping Pong flottante -

ESP Web Server

+

Balle Ping Pong flottante

%BUTTONPLACEHOLDER%