Finally got the code working properly to randomise text from Robert Burns Poem about water. Not the hardest of codes but still I’m reasonably chuffed about how it works.
char *poem[]={“once”, “there”, “was”, “water”, “dancing”, “everywhere”, “it”, “flowed”, “tumbled”,”tossed”, “and”, “danced”, “singing”, ”the”, “story”, “of”, “our” , “for-fathers”,”Flow”, “gently”, “sweet”,”Afton”,”among”,”thy”,”green”,”braes”, “Flow”,”gently”,”I’ll”,”sing”,”thee”,”a”,”song”, “in”, “thy”,”praise”,”My”, “Mary’s”, “asleep”, “by”, “thy”, “murmuring”, “stream”,”Flow”, “gently”, “sweet”, “Afton”, ”disturb”, “not”, “her”, “dream”, “Thou”, “stock-dove”, “whose”, “echo”, “resounds”, “thro’”, “the”, “glen”,”Ye”, “wild”, “whistling”, “blackbirds”, “in”, “yon”, “thorny”, “den”,”Thou”, “green”,”crested”, ”lapwing”, “thy”, “screaming”, “forbear”,”I”, “charge”, “you”, “disturb”, “not”, “my”, “slumbering”, “fair”,”How”,”lofty”, “sweet”
/*Afton, thy neighbouring hills,Far mark’d with the courses of clear winding rills;There daily I wander as noon rises high, My flocks and my Mary’s sweet cot in my eye.
How pleasant thy banks and green valleys below, Where wild in the woodlands the primroses blow; There oft, as mild Ev’ning sweeps over the lea, The sweet-scented birk shades my Mary and me.
Thy crystal stream, Afton, how lovely it glides, And winds by the cot where my Mary resides, How wanton thy waters her snowy feet lave, As gathering sweet flowrets she stems thy clear wave.
Flow gently, sweet Afton, among thy green braes, Flow gently, sweet river, the theme of my lays; My Mary’s asleep by thy murmuring stream, Flow gently, sweet Afton, disturb not her dream*/
};//char
poemlong word1;
//long word2;
void setup(){
Serial.begin(9600);
randomSeed(666);//randomise text
}
void loop() {
word1 = random(sizeof(poem)/sizeof(char*));
//choose one of the words
//word2 = random(sizeof(poem)/sizeof(char*));
Serial.println(poem[word1]);//print it
// Serial.println(poem[word2]);
//need to figure out code to display this in IR led format….help
delay(10000);//wait 10 seconds go again}
So the idea is to load these onto each poem box with unique poems and see what connections can be produced from these poems and these locations.