Webform switch between continuous and cycle sending #12

Merged
W1CDN merged 9 commits from continuous-or-cycle into main 2023-09-02 18:49:25 -05:00
Showing only changes of commit 13ddf853ed - Show all commits

View File

@ -55,17 +55,13 @@ const char index_html[] PROGMEM = R"rawliteral(
</script></head><body> </script></head><body>
<form action="/get" target="hidden-form"> <form action="/get" target="hidden-form">
inputString (current value %inputString%): <input type="text" name="inputString" value=%inputString%><br> inputString (current value %inputString%): <input type="text" name="inputString" value=%inputString%><br>
<!--
<input type="submit" value="Submit" onclick="submitMessage()"> Sending program:
</form><br> <select name="inputInt" id="send-program">
<form action="/get" target="hidden-form"> <option value="1">Continuous</option>
--> <option value="0">Cycle</option>
Seconds between flash (current value %inputInt%): <input type="number " name="inputInt" value = %inputInt%><br> </select><br>
<!--
<input type="submit" value="Submit" onclick="submitMessage()">
</form><br>
<form action="/get" target="hidden-form">
-->
inputFloat (current value %inputFloat%): <input type="number " name="inputFloat" value = %inputFloat%><br> inputFloat (current value %inputFloat%): <input type="number " name="inputFloat" value = %inputFloat%><br>
<input type="submit" value="Submit" onclick="submitMessage()"> <input type="submit" value="Submit" onclick="submitMessage()">
</form> </form>
@ -144,7 +140,7 @@ void writeFile(fs::FS &fs, const char * path, const char * message){
file.close(); file.close();
} }
// Replaces placeholder with stored values // Replaces placeholder in web UI with stored values
String processor(const String& var){ String processor(const String& var){
//Serial.println(var); //Serial.println(var);
if(var == "inputString"){ if(var == "inputString"){
@ -365,14 +361,14 @@ void loop() {
// float yourInputFloat = readFile(SPIFFS, "/inputFloat.txt").toFloat(); // float yourInputFloat = readFile(SPIFFS, "/inputFloat.txt").toFloat();
// if you want to send code, and it's not sending, then start it up // if you want to send code, and it's not sending, then start it up
if((yourInputInt != 0) & (morseLed.IsRunning() == false)){ if((yourInputInt == 1) & (morseLed.IsRunning() == false)){
//jled //jled
morseLed.Reset().Update(); morseLed.Reset().Update();
//morse.send("CQ CQ CQ DE W1CDN K"); //etherkit morse //morse.send("CQ CQ CQ DE W1CDN K"); //etherkit morse
//telegraph26.send("CQ CQ CQ DE W1CDN K"); //telegraph //telegraph26.send("CQ CQ CQ DE W1CDN K"); //telegraph
// if you want to send code, and it is sending, keep sending // if you want to send code, and it is sending, keep sending
} else if((yourInputInt != 0) & (morseLed.IsRunning() == true)){ } else if((yourInputInt == 1) & (morseLed.IsRunning() == true)){
morseLed.Update(); morseLed.Update();
// if you don't want to send code // if you don't want to send code
} else { } else {