cities and knites

I’ve built a dice roller to play dice games with and I’m trying to build a game that requires a byte to show up in a spot (on the screen)

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
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...
  }
byte customChar[8] = {
  0b00000,
  0b10101,
  0b11111,
  0b11111,
  0b11001,
  0b11001,
  0b11001,
  0b11111
};
void setup() {
  
     // create a new custom character
    lcd.createChar(0, customChar);
    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() {
    long diceOne = random(1, 7);
    long diceTwo = random(1, 7);
    char color[3]= {'R','Y','B'};
    long c = color, random(1,3);
    int total = diceOne + diceTwo;
   
    lcd_key = read_LCD_buttons();  // read the buttons

    if (lcd_key == btnSELECT) {
      lcd.clear();
      lcd.setCursor(5, 0);
      lcd.print(total);
      lcd.setCursor(7,0);
      lcd.print(customChar);
      lcd.setCursor(7,1);
      lcd.print(c);
    
      analogRead(lcd_key == btnSELECT);
      delay(100);
      analogRead(lcd_key == btnSELECT);
      delay(100);
    
    }

this is the error I keep getting

Arduino: 1.8.9 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: conversion of argument 1 would be ill-formed:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int)

size_t print(long, int = DEC);

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: conversion of argument 1 would be ill-formed:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int)

size_t print(unsigned long, int = DEC);

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: conversion of argument 1 would be ill-formed:

cities_and_knites_Test_apr07a:92:5: error: expected ‘}’ at end of input

}

exit status 1
no matching function for call to ‘print(byte [8])’

tarbear123: no matching function for call to 'print(byte [8])'

Please study the example code in the reference page for the LiquidCrystal library's createChar() function in order to learn how to use the library properly: https://www.arduino.cc/en/Reference/LiquidCrystalCreateChar If you follow that example faithfully, the error will be fixed.

Next error:

tarbear123: cities_and_knites_Test_apr07a:92:5: error: expected '}' at end of input

A very helpful troubleshooting tool is the Auto Format feature (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor). If you do an Auto Format and then compare the resulting indentation to your intended program structure, it will quickly point you to where there is a missing or extra brace.

Another useful feature of the Arduino IDE/Arduino Web Editor is that when you place the cursor next to one bracket, it puts a box around the matching bracket. In the Arduino IDE, if the cursor is next to the closing bracket and the opening bracket is off the screen then it will show the opening bracket line in a tool tip after a short delay.

If you add the missing brace in the correct location, this error will be solved.