Storing numbers and letters in the same variable

Hi there. I am trying to write a code which checks if there is any serial input. If there is serial input it reads it and stores it in a variable. The variable is then checked to a known value using an if statement. If they are the same it should display on the serial monitor. I checked around and can't figure out how to store the "thisWillNotWork" variable. What do I need to do to store that variable.

#include "Nextion.h"

//This is the code that is sent from the touch screen display
thisWillNotWork = 65 00 02 01 FF FF FF;

void setup()
  /* Set the baudrate which is for debug and communicate with Nextion screen. */


void loop(void)

  //Checks to see if any text was sent from the display
  if (Serial.available() > 0) {
    //reads and stores the information
    byte incomingByte =;
  //if the information is the same as the known value it displays the serial print
  if ( incomingByte = thisWillNotWork) {

    Serial.print("The plus sign was pressed");




Well to compare two things, you need to use the comparison operator ==, not the assignment operator =. However, you're unlikely to be able to use a simple comparison because you're either going to be using an array or a struct, so memcmp may be the way ahead.

I can understand storing the "thisWillNotWork" variable as an array but how would I save the "incomingByte" as an array?

Did you look at Robin2's serial basics thread?

You should.

Thanks for the pointer to check that thread out. It was helpful but it still didn't answer my question of how to declare the first array since it contains both numbers and integers I can't declare it an int.

byte thisMayWork = {0x65, 0x00, 0x02, 0x01, 0xFF, 0xFF, 0xFF};

Or maybe I don't understand your problem.

Thank you, that worked, I only had to change add brackets.

byte thisMayWork[] = {0x65, 0x00, 0x02, 0x01, 0xFF, 0xFF, 0xFF};

Oh dear, sorry, that was bad of me .