BYTE keyword not supported in 1.0

I am using a code I got from the web to control stepping up/down 5 led’s with the use of two push buttons. However when i compile the sketch I get an error code telling me BYTE is not supported by 1.0 use serial.write() instead. BUT it says BYTE nowhere in my sketch… HELP please!!!

// Example 03C: Turn on LED when the button is pressed
#include <Bounce.h>

#define NUM_MOODS 5
#define NEUTRAL ((NUM_MOODS - 1) / 2)

#define UP ‘+’
#define DOWN ‘-’
#define QUERY ‘?’
#define NONE -1

int ledPins[NUM_MOODS] = {6, 7, 8, 9, 10};
int heartbeatPin = 13;
int upPin = 2;
int downPin = 3;

Bounce upButton (upPin, 100);
** Bounce downButton (downPin, 100);**

int mood = NEUTRAL;
void setup() {
for (int i = 0; i < NUM_MOODS; ++i) {
pinMode(ledPins*, OUTPUT);*

  • }*

  • pinMode(upPin, INPUT);*

  • pinMode(downPin, INPUT);*

  • Serial.begin(9600);*

  • setMood(NEUTRAL);*

  • }*
    void loop() {

  • upButton.update();*

  • downButton.update();*

  • int button = (upButton.fallingEdge() ? UP :*

  • (downButton.fallingEdge() ? DOWN : NONE));*

  • int serial = (Serial.available() > 0 ? Serial.read() : NONE);*

  • int event = (button != NONE ? button : serial);*

  • switch (event) {*

  • case UP:*

  • setMood(mood + 1);*

  • break;*

  • case DOWN:*

  • setMood(mood - 1);*

  • break;*

  • case QUERY:*

  • Serial.print(‘0’ + mood, BYTE);*

  • break;*

  • default:*

  • setMood(event - ‘0’);*

  • break;*

  • }*

  • digitalWrite(heartbeatPin, HIGH);*

  • delay(50);*

  • digitalWrite(heartbeatPin, LOW);*

  • delay(50);*

  • }*
    void setMood(int newMood) {

  • if (newMood < 0 || newMood >= NUM_MOODS) {*

  • return;*

  • }*

  • digitalWrite(ledPins[mood], LOW);*

  • mood = newMood;*

  • digitalWrite(ledPins[mood], HIGH);*

  • }*
    The problem is in bold in my sketch

BUT it says BYTE nowhere in my sketch.....

Except for:

          Serial.print('0' + mood, BYTE);

ok so what do i do to fix it???

The error message told you what to do.

BYTE is not supported by 1.0 use serial.write() instead

As I presume you didn’t read the release notes (http://arduino.cc/en/Main/ReleaseNotes) when you downloaded the IDE, here is the relevant part:

  • The behavior of Serial.print() on a byte has been changed to align it
    with the other numeric data types. In particular, it will now print
    the digits of its argument as separate ASCII digits (e.g. ‘1’, ‘2’, ‘3’)
    rather than a single byte. The BYTE keyword has been removed. To send a
    ** single byte of data, use Serial.write()** (which is present in Arduino 0022
    as well).

Here is a link to Serial.write(): http://arduino.cc/en/Serial/Write

You could have done some research yourself. This site contains all the information you need.

I already read that..... maybe I am just dumb