Pages: [1]   Go Down
Author Topic: #define BUTTON not recognized?  (Read 697 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Day 2 of working with the board and just tryint to work through the examples here.

When I try to verify the press button example (exactly as it appears in teh book) the second #define statement (#define BUTTON 7) keeps giving an error message. The error says: "Unexpected unqualified-id before numeric constant."

I've tried all the fixes I can think of, checked the grammar for #define and even changed the variable name, all with no luck. The #define LED 13 statement immediately before this isn't causing a problem.

Can anyone see what the problem is here or steer me in the right direction?

Cheers,

Ray
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, never mind.

The syntax problem was on the NEXT line. No ; after the val statement.

Sheesh!

R
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31382
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That is a very important lesson, remember it well.
The error often is in the line before or after the one the compiler chokes on.
Logged

Pages: [1]   Go Up
Jump to: