Custom LCD Characters giving me an error

At the moment, I just want my lcd to print a custom character, one I made called “cacti”. I have looked around but nothing has helped so far.

Code:

#include <LiquidCrystal.h>
#include <Wire.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int btnUp = 8;
const int btnDown = 9;

int btnUpState = 0;
int btnDownState = 0;

//sprites
byte cacti[] = {
  B00101,
  B00101,
  B00111,
  B10100,
  B11100,
  B00100,
  B00100,
  B00100
};

void setup() {
  pinMode(btnUp, INPUT_PULLUP); //Use internal pullup
  pinMode(btnDown, INPUT_PULLUP); //Use internal pullup
  
  lcd.begin(16, 2);
  lcd.createChar(0, cacti);
  lcd.home();
  lcd.setCursor(7, 0);
  lcd.write(cacti);
  
  Serial.begin(9600);
}

void loop() {
  
}

Error message:
no matching function for call to ‘write(byte [8])’

please help :(

See the documentation for the LiquidCrystal library's createChar function: https://www.arduino.cc/en/Reference/LiquidCrystalCreateChar

To display a custom character on the screen, write() its number.

NB : When referencing custom character "0", if it is not in a variable, you need to cast it as a byte, otherwise the compiler throws an error.

So you need to write the number of the custom character you defined, like this:

lcd.write(byte(0));

but you did this instead:

lcd.write(cacti);

thus the error.

Oh. Thanks! To make it variable, do I just do

cacti = BYTE CODE HERE{};

?