HEX array syntax issue with If()

A part of my code isn’t working as expected.

“Serial.print(addr[1],HEX);” prints out ‘B5’ but “if(addr[1],HEX == ‘B5’)”{Serial.print(“Inside”);} does not cause the program to enter the if loop.

I believe my syntax is faulty, but not sure how to fix it. I have tried several variations but nothing works. I must be missing something.

#include <OneWire.h>
#include <NewSoftSerial.h>

/* DS18B20 Temperature Address Locations

Mudroom   =   28 45 D5 F6 1 0 0 DF
Inside    =   28 B5 CF F6 1 0 0 6C
Outside   =   28 D7 F2 AF 2 0 0 6
Garage    =   28 E6 4 B0 2 0 0 44

Scans through 4 sensors and prints the embedded serial code for each with array addr[].
Then it does a temperature lookup for each device and prints the temp.

OneWire  ds(10);  // on pin 10

void setup(void) {

void loop(void) {
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];
  int Temp;
  if ( !ds.search(addr)) {
  // prints out the whole address, this part works but not needed
  // used initially to get the full address lines
  /*for( i = 0; i < 8; i++) {
    Serial.print(addr[i], HEX);
    Serial.print(" ");

  //Prints out just the 2nd entry in address, what I want to split from
  Serial.print(addr[1],HEX);   // inside sensor always pritns B5
  Serial.print(" ");

  // This part is not working, I have it just set up for Inside for now
  // once that works, I will expand for the rest.
  if(addr[1],HEX == 'B5'){
    Serial.print("Inside : ");
    // if i can get this part working, i'd be able to eventually save the
    // temperature from this specific sensor into it's own variable
    // for further manipulation.

  // The rest of the code works as expected
  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.print("CRC is not valid!\n");

  if ( addr[0] != 0x28) {
      Serial.print("Device is not a DS18S20 family device.\n");

  ds.write(0x44,1);        // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.write(0xBE);        // Read Scratchpad

//  Prints out a bunch of information about the device, not used
//  Serial.print("P=");
//  Serial.print(present,HEX);
//  Serial.print(" ");
  for ( i = 0; i < 9; i++) {          // we need 9 bytes
    data[i] = ds.read();
//    Serial.print(data[i], HEX);
//    Serial.print("  ");
  Temp=(data[1]<<8)+data[0];//take the two bytes from the response relating to temperature

  Temp=Temp>>4;//divide by 16 to get pure celcius readout

  //next line is Fahrenheit conversion

  Serial.print("Temperature = ");
  Serial.print("  ");

//  Prints out CRC = whatever
//  Serial.print(" CRC=");
//  Serial.print( OneWire::crc8( data, 8), HEX);
if(addr[1],HEX == 'B5'){

Lots of things wrong here.

16 (HEX) does not equal the multicharacter constant 'B5'. addr[1] is evaluated and discarded.

if(addr[1] == 0xB5){


I believe I tried that one, but I used 0xB5, not sure if capital 'X' makes a difference as a hex designator. I wish I had recorded all my attempts and the result of each. When I get home from work I will try to document better and add to the post if necissary. Thanks for the input

AWOL, thanks for the suggestion. I tried uploading after that change and it worked. Thanks for the quick response, much appreciated! cheers!