Need Help with basic stuff.

So im trying to do the Fruit one where you chose if banana or apple is true/false. Eitherway i copied the entire code from the book but it still seems to be something wrong.

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Documents\Arduino\sketch_jan17d\sketch_jan17d.ino: In function 'void loop()':

sketch_jan17d:16: error: 'likeBananas' was not declared in this scope

else if(LikeApples == false && likeBananas == true) {

^

sketch_jan17d:30: error: expected primary-expression before '}' token

}

^

exit status 1
'likeBananas' was not declared in this scope

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

You need to post your code, as typed.

Probably a simple typo, maybe upper vs lower case or similar.

LikeApples has capital-L, so perhaps likeBananas should be LikeBananas?

Couldn't find any typos, here's the full thing if it helps

const boolean LikeApples = false;
const boolean LikeBananas = true;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600) ;

}

void loop() {
// put your main code here, to run repeatedly: Print what kind of fruits you like
if(LikeApples == true && LikeBananas == false) {
Serial.println("Have An Apple") ;
}
else if(LikeApples == false && likeBananas == true) {
Serial.println("Have a Banana") ;
}
else if(LikeApples == true && LikeBananas == true) {
Serial.println("Have Some Fruit Salad Mate") ;

}
else {
Serial.println("Y u no vegan") ;
}

delay (1000) ,

}

Above the line Have a Banana you have likeBananas with small-l as I said. Declaration at the top has LikeBananas capital-L.

Change like to Like....

And then change the , at the very bottom after delay(1000) to a ;

problem solved guys, typo was found but couldn't repost due to time limit. Thanks for the help. Unbelivable how one typo can mess everything up completely.

Wombatlord:
Unbelivable how one typo can mess everything up completely.

Two, but who's counting :wink:

Wombatlord:
Unbelivable how one typo can mess everything up completely.

That's because computers are unbelievably stupid.

...R