Random from a char array

I’ve built a dice generator to play left right center, i want to press the select button to generate 3 random letters L R C in three positions on the lcd, i want it to generate different letters in the different positions
plz help

#include <LiquidCrystal.h>
LiquidCrystal lcd (8, 9, 4, 5, 6, 7);
#include <stdlib.h>
int randNumber = 0;
// define some values used by the panel and buttons
int lcd_key = 0;
int adc_key_in = 0;
#define btnRIGHT 0
#define btnUP 1
#define btnDOWN 2
#define btnLEFT 3
#define btnSELECT 4
#define btnNONE 5
// read the buttons
int read_LCD_buttons() {
adc_key_in = analogRead(0); // read the value from the sensor
// my buttons when read are centered at these valies: 0, 144, 329, 504, 741
// we add approx 50 to those values and check to see if we are close
//if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
// For V1.1 us this threshold

if (adc_key_in > 1000) { return btnNONE; }

// For V1.0 comment the other threshold and use the one below:

if (adc_key_in < 50) { return btnRIGHT; }

if (adc_key_in < 195) { return btnUP; }

if (adc_key_in < 380) { return btnDOWN; }

if (adc_key_in < 555) { return btnLEFT; }

if (adc_key_in < 790) { return btnSELECT; }

return btnNONE; // when all others fail, return this…
void setup() {
lcd.begin(16, 2); // start the library
lcd.setCursor(0, 0);
lcd.print(“press select to dice”); // print a simple message
randomSeed (analogRead (1));
void loop(){
array a = (“L” “C” “R”)
char entry = a[rand()%4];
lcd_key = read_LCD_buttons(); // read the buttons

if(lcd_key == btnSELECT) {
lcd.setCursor(2, 0);
lcd.setCursor(8, 0);
analogRead(lcd_key == btnSELECT);
analogRead(lcd_key == btnSELECT);

Please remember to use code tags when posting code.

array a = ("L" "C" "R")
char entry = a[rand()%4];

You got a ton of compilation errors.

How about posting those?

Arduino: 1.8.8 (Windows 10), TD: 1.45, Board: "Arduino Nano, ATmega328P"

C:\Users\taran\Documents\Arduino\LEFT_RIGHT__CENTER\LEFT_RIGHT__CENTER.ino: In function 'void loop()':

LEFT_RIGHT__CENTER:45:1: error: 'array' was not declared in this scope

array a = ("L" "C" "R")


LEFT_RIGHT__CENTER:52:19: error: 'a' was not declared in this scope



LEFT_RIGHT__CENTER:61:18: error: expected '}' at end of input



exit status 1
'array' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

There you go - array was not declared in this scope - properly.
Read about declaring and initialising arrays.

        analogRead(lcd_key == btnSELECT);

Why are you reading from the true pin? Or is that the false pin? What were you thinking?

Programming DOES involve thinking, not random plonking of keys.

the buttons on the shield are attached to A0 and the code is to make it not run all the time

the code is to make it not run all the time

The two useless calls to analogRead() do nothing of the sort.

You may need to go look at the button example for your shield.
It’s a little more complex when reading a resistor-switch ladder.