Back to Parent

//////////PRINTER/////////////////

//algorithm to choose image to print

String chooseImage(const char* fortune){

String img;

if (fortune == "long"){

//choose a symbol from 'good' symbols

long imgN = random(0, 3);

img = goodSymbols[imgN];

Serial.print("long symbol"); Serial.println(imgN);

} else if (fortune == "medium"){

//choose a symbol from 'neutral' symbols

long imgN = random(0, 2);

img = neutralSymbols[imgN];

Serial.print("medium symbol"); Serial.println(imgN);

} else {

//choose a symbol from 'bad' symbols

long imgN = random(0, 3);

img = badSymbols[imgN];

Serial.print("short symbol"); Serial.println(imgN);

}

return img;

}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0