"BYTE" doesn't work

Ok so I am doing a project from the book Arduino Cookbook - Micheal Margolis

and on page 89 (of the book not the reader)

So here is the code

// You want to send serial data from Arduino displayed as text, decimal values, hexadecimal, or binary.

/*
 * SeriaFormatting
 * Print values in various formats to the serial port.
 */
char chrValue = 65;
int intValue = 65;
float floatValue = 65.0;

void setup() {
    Serial.begin(9600);
  }

void loop() {
  Serial.println("chrValue: ");
  Serial.println(chrValue);
  Serial.println(chrValue,BYTE);  // need to be reworked
  Serial.println(chrValue,DEC);
  Serial.println("intValue: ");
  Serial.println(intValue);
  Serial.println(intValue,BYTE);  // need to be reworked
  Serial.println(intValue,DEC);
  Serial.println(intValue,HEX);
  Serial.println(intValue,OCT);
  Serial.println(intValue,BIN);

  Serial.println("floatValue: ");
  Serial.println(floatValue);

  delay(1000); //  delay a second between numbers
  chrValue++; // to the next value
  intValue++;
}

And the image is what I get.

I researched and all I get is the word byte not BYTE.

I need help

Thanks for helping me this is my first time in the forum so I'm sorry for the bad formatting.

If the picture doesn't work then here is the error message

Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\kati\Documents\Arduino\Arduino Jar(Arduino Cookbook)\SerialFormatting\SerialFormatting.ino: In function 'void loop()':

SerialFormatting:18: error: The 'BYTE' keyword is no longer supported.
As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.


   Serial.println(chrValue,BYTE);  // need to be reworked

                           ^

exit status 1
The 'BYTE' keyword is no longer supported.

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

It tells you what to do... If you just want to send out the value as a byte, not a ASCII char, you use Serial.write(chrValue);

@septillon (I don't know how to address people)

I tried to do Serial.write already but it still comes up with the same error

"BYTE" keyword is no longer supported.

What do I use then?

What do I use then?

Serial.write() with JUST the value. Loose the stupid , BYTE part of the statement!

Like Paul said, if you still get the error you didn't do as I (and the compiler) told you :wink: