The name of this thread is courtesy of @EmilyJane, based on a thread that fits in the "I always try my hardest to answer a post when..." Bar Sport discussion of fame.
What follows is a continuation of an Arduino project in the thread that brought me to post this one and is intended to help those who refuse to read the "How to Get The Best of The Forum" post.
The sketch includes the fine code revisions of @evanmars, likewise generous in their attempt to bring clarity and harmony to the chaotic universe.
I will cc @camsysca , @alto777 , @docdoc , @ruilviana , @TomGeorge , @kmin @xfpd , @outbackhut who know what I'm blathering about and who exhibit everlasting patience. You are all Royalty amongst commoners like me. If your name isn't here but you feel it should be, I apologize. Either I missed it or, like JohnLincoln, it was not mentioned due to 10 mention per post forum limit. What kind of party is that, Arduino Forum?
Without further ado and using frickin' CODE TAGS, I humbly present the following sketch for your consideration:
/*
Set Serial monitor to 9000 baud, no line ending
Circuit: Just an Arduino Uno R3
By hallowed31, June 20, 2025
Adapted from evanmars's code based on hallowed31's OG 1.0
Working as intended.
Update (v2.0) -- yeah, right! Skipped to be awesomer. Straight to v3.0 for the kid here
Future update (v∞AndBeyond)
TODO: achieve forum Nirvana
*/
char inChar;
byte mode = 0;
byte scriptCounter = 0;
unsigned long ma, lastMa;
void setup() {
Serial.begin(9600);
twentyBlankLines();
Serial.println(F("How to use the <CODE/> button in the forums super deluxe vTHREE.0"));
Serial.println(F("Press SPACE BAR + Enter to begin your spiritual journey into logic and reason...\n\n"));
while (inChar != ' ') {
if (Serial.available() > 0) {
inChar = Serial.read();
if (inChar == ' ') break;
}
}
showMenu();
}
void loop() {
if (scriptCounter == 1) mode = 4;
if (Serial.available() > 0) {
char switchMode = Serial.read();
switch (switchMode) {
case ' ': // space bar
mode = 1; //menu
break;
case 'h':
scriptCounter = 0;
mode = 2; // hallowed31
break;
case 'e':
scriptCounter = 0;
mode = 3; // evanmars
break;
}
}
switch (mode) {
case 1:
showMenu();
break;
case 2:
if (scriptCounter == 0) {
twentyBlankLines();
Serial.println(F("the hallowed31 Contention:\n"));
theHallowed31Contention();
scriptCounter = 1;
}
break;
case 3:
if (scriptCounter == 0) {
twentyBlankLines();
Serial.println(F("the evanmars Dialectic:\n"));
theEvanMarsDialectic();
scriptCounter = 1;
}
break;
case 4:
splash();
break;
}
}
void theHallowed31Contention() {
// for loop repacked to function and called in state machine
Serial.println(F("How to use the <CODE/> button in the forums v1.0"));
Serial.println();
delay(1000);
Serial.println(F("1. Copy your auto formatted code to your clipboard with CTRL + C"));
delay(1000);
Serial.println(F("2. In the forum window, click the <CODE/> button"));
delay(1000);
Serial.println(F("3. Without deleting the six little ` marks..."));
delay(1000);
Serial.println(F("4. ... highlight the line that says: paste your code here, then"));
delay(1000);
Serial.println(F("5. paste your code between those marks using CTRL + V"));
delay(1000);
Serial.println(F("Optional: use your arrow key down to go past the code to protect ``` "));
}
void theEvanMarsDialectic() {
/* note, for loop removed from evanmars orig. Should not alter spirit of orig text.
I mean, this isn't the Bible, after all.
Or is it? [insert spooky musical internal monologue here] */
// what follows is all verbatim from orig scrolls
Serial.println("How to post code in the forums v1.0");
Serial.println();
delay(1000);
Serial.println("1. Copy your auto formatted code Ctrl-Shift-C");
delay(1000);
Serial.println("2. In the forum window, click the Ctrl-V");
delay(1000);
Serial.println("3. DO NOT delete the six little ` marks...");
delay(1000);
Serial.println("Optional: use your arrow key down to go past the code to protect ``` ");
}
void showMenu() {
Serial.println(F("Key Commands: "));
Serial.println(F(" e to view evanmars Dialectic"));
Serial.println(F(" h to view hallowed31 Contention\n\n"));
Serial.println(F(" Type X to return"));
Serial.println(F("then Space bar + Enter during the feature discussion to review menu options\n\n"));
while (!Serial.available()) {
}
if (Serial.available() > 0) {
char escape = Serial.read();
switch (escape) {
case 'h':
scriptCounter = 0;
mode = 2;
break;
case 'H':
scriptCounter = 0;
mode = 2;
break;
case 'e':
scriptCounter = 0;
mode = 3;
break;
case 'E':
scriptCounter = 0;
mode = 3;
break;
case 'x':
mode = 4; //splash
break;
case 'X':
mode = 4; //splash
break;
}
}
}
void splash() {
ma = millis();
const unsigned long maTime = 5000;
if (ma - lastMa >= maTime) {
lastMa = ma;
Serial.println(F("\n e to view evanmars Dialectic"));
Serial.println(F(" h to view hallowed31 Contention\n"));
}
}
void twentyBlankLines() {
for (int i = 0; i < 20; i++) {
Serial.println();
}
}
Note that this was posted to the forum using the hallowed31 Contention.