Code:
void random_code() {
String code_char = "abcdefghijklmnopqrstuvwxyz,.0123456789\0";
String send_char;
randNumber = random(38);
send_char = "send_" + (code_char.substring(randNumber, randNumber + 1) + "()");
//
// !!! I need code here to call a procedure that is the string send_char !!!
//
Serial.println(send_char); // what command(s) do I put here?
delay(5);
}
// These are examples of the procedures I want void random_code() to call
void send_a() {
dit(); dah();
letter_space();
}
void send_b() {
dah(); dit(); dit(); dit();
letter_space();
}
Hope it's clear what I want to do. Also hope it can be done. I'm skeptical.
Will substring recognise "\0" as end of string, or will it look for char 38? I could remove random and test for it.