How to print random text
i wondering if can me code print random text. heres pseudo code.
randomname = john or fred or peter or jim;
serial.print("hello "(randomname));
this hello 1 of of names listed picked randomly.
randomname = john or fred or peter or jim;
serial.print("hello "(randomname));
this hello 1 of of names listed picked randomly.
something this:

quote
const byte number_of_names = 4;
char* names[number_of_names] = {
"john",
"fred",
"peter",
"jim"
};
void setup(){
serial.begin(9600);
randomseed(analogread(0));
serial.print("hello ");
serial.println(names[random(0,number_of_names)]);
}
void loop(){
}

Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > How to print random text
arduino
Comments
Post a Comment