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.

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

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums